Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently mounting my external harddrive using the following entry in /etc/fstab:

UUID=12C23AD8C23AC031    /media/MyBook ntfs-3g auto,users,exec,rw,nobootwait,iocharset=utf8,uid=1000,gid=1000 0 0

In addition to that, I also need to run mount as follows (which I currently only do before starting Steam, but it's getting annoying to constantly do so; I would prefer it was automated):

sudo mount --rbind /media/MyBook/Games/SteamData /home/andreas/.local/share/Steam/

Is there any way to automatically mount the SteamData folder whenever the drive "My Book" is mounted? There are answers on how to run a shell script when a drive is mounted, but is it better/possible to do this directly from fstab?

Note that my external harddrive may not be available at boot, and may be plugged in at a later time.

share|improve this question

the fstab entry would be:

/source/dir            /destination/dir    none  bind            0 0


/media/MyBook/Games/SteamData     /home/andreas/.local/share/Steam/   none  bind     0   0

be certain you have full perms to this folder, unless you want a r/o mount.

share|improve this answer
Would this work even if MyBook isn't mounted at boot? (the path /media/MyBook/Games/SteamData would not exist) Would it still work if MyBook were plugged in later on? – IQAndreas Aug 9 '13 at 21:24
no.. for hot plugging you would need to use udev rules, and thats over my head as of this moment, but since you have the MyBook in fstab the kernel would throw an error at boot if the device didn't exist at boot time, so it might be wise to just use udev rules to make this work, unless you never remove the device the fstab is the fastest solution – Spilt_Blood Aug 10 '13 at 10:48
"since you have the MyBook in fstab the kernel would throw an error at boot if the device didn't exist at boot time" - That's why I used the nobootwait flag in the fstab entry. Before I learned about it, I used to just press s to skip if it wasn't connected at boot. – IQAndreas Aug 10 '13 at 13:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.