PDA

View Full Version : mounting a folder on a vfat partition when booting



reut2
November 12th, 2015, 07:24 PM
I can mount the folder using:

mount --bind /home/MyDocsOld/"My Documents" /home/reuven/"My Documents"
I recently added the following two lines to my /etc/fstab:

UUID=CDC4-53E2 /home/MyDocsOld vfat defaults,umask=007,gid=46 0 0
/home/MyDocsOld/"My Documents" /home/reuven/"My Documents" none bind

When I boot up I get a message that reads:

An error occured while mounting Documents".

Can someone tell me the correct fstab line to accomplish this please?

SeijiSensei
November 13th, 2015, 02:15 AM
Try wrapping the whole pathname in quotes like this: "/home/reuven/My Documents"

or use the backslash to "escape" the space like this: /home/reuven/My\ Documents without any quotes.

reut2
November 13th, 2015, 08:17 PM
Try wrapping the whole pathname in quotes like this: "/home/reuven/My Documents"

or use the backslash to "escape" the space like this: /home/reuven/My\ Documents without any quotes.

After trying these suggestions and getting no success, I mounted the folder manually and copied the mtab line into the fstab file, and now it is working I'm not exactly understanding what the 040 is in there:

/home/MyDocsOld/My\040Documents /home/reuven/My\040Documents none rw,bind 0 0

sisco311
November 13th, 2015, 09:16 PM
040 is the ASCII code of the space character in octal.

\ is the escape character and \040 is called an escape sequence.

Spaces and tabs have special meaning in the fstab file. They are used as field separators.

In the shell (bash,dash...) you can use single and double quotes or the escape character (the backslash) to remove the special meaning of certain characters. But in the fstab file you are limited to use the \xxx escape sequence.

reut2
November 14th, 2015, 01:40 AM
Thank you!