HOWTO: Allow spaces in the mount name

Have you ever tried to create a mount point with a space in it? Well, I have and what I got was a mounted folder which is accessible via network, but FreeNAS is showing an error next to that mount point. The reason why FreeNAS is showing an error is because it finds the mount point /path/to/your/mount point as /path/to/your/mount which, of course, is not a match.

So, to fix this, do the following:
1) Open /etc/inc/util.inc for editing
2) Find a function called get_mounts_list and change the line
if (0 == preg_match("/^(\S+) on (\S+).+fsid (\S+).+/", $line, $aline))
to
if (0 == preg_match("/^(\S+) on ([\w\d\s.\/]+).+fsid (\S+).+/", $line, $aline))
Once done, everything should work and you will not have any issues with the spaces in mount points!

Comments