4

I have a drive mounted at /media/ that contains a directory with a space in the name - let's call it "My Stuff".

I would like to bind mount it to "My Stuff" in my home directory. I tried the following in fstab, but all attempts to mount resulted in a syntax error:

/media/My\ Stuff /home/me/My\ Stuff none bind
"/media/My\ Stuff" "/home/me/My\ Stuff" none bind
"/media/My Stuff" "/home/me/My Stuff" none bind

Is there a way to do this?

2 Answers 2

5

You need to replace every occurence of space within the directory path by \040 in your fstab file.

So try :

/media/My\040Stuff /home/me/My\040Stuff none bind 0 0
1
  • You may need to first create the /home/me/My\ Stuff directory Dec 19, 2012 at 4:11
0
mount --bind /media/My\ Stuff /home/me/My\ Stuff

run the command as root user or prefix with sudo

3
  • I suspect the user knew that because of the examples they gave that didn't work, but wants a line that will function in fstab not just from the command-line. Dec 19, 2012 at 3:28
  • Right. I want this permanent.
    – chris
    Dec 19, 2012 at 3:29
  • Try:"/media/My Stuff" "/home/me/My Stuff" bind 0 0 or you may need the '\ ', but drop the none before bind
    – user168261
    Dec 19, 2012 at 3:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .