fstab : mount points with spaces ???

Vincent Trouilliez vincent.trouilliez at modulonet.fr
Thu Jul 14 05:39:19 UTC 2005

Me again, fiddling with fstab...

I am trying to make the icons for my partitions, have a nice looking
label so that it's more informative and more pleasing to look at.

For example the installer mounted my Hoary system partition
in /media/hda2, and therefore everywhere in Gnome I see 'hda2', not very
sexy. I would prefer to see say : "Hoary - System", and would rather
avoid ugly underscore "Hoary_System".
Same goes for other partitions as well.

I had success creation the mount points/directories in  /media, using
quotes : sudo mkdir 'Hoary - System'

And the, using quotes again, I have no problem mounting the partition
like this : sudo mount /dev/hda2 '/media/Hoary - System'

THE PROBLEM, is that when I use quote in fstab to surround the mount
point, like this :

/dev/hda2 '/media/Hoary - System'  vfat   <options...>

Then asks mount to look it up in fstab : mount /dev/hda2, it won't mount
it and generate an error, saying that : 

[mntent]: line 9 in /etc/fstab is bad
mount: can't find /dev/hdb1 in /etc/fstab or /etc/mtab

If I omit the quotes altogether in fstab, it gives the same error, which
this time is understandable as it messes up the structure of the line...

I thought that fstab was only there for 'mount' to have a list of drives
to mount and there options, at boot time, hence I thought that if at the
command line, mount accepts mount points with spaces in them, then fstab
would have to, too.

If this a bug in fstab, and if not, what is the syntax I should use in
fstab, to specify mount points with spaces in them ?

Thank you !!! :-)


More information about the ubuntu-users mailing list