Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have FSAT setup to mount a CIFs share, but on boot up the share never gets mounted. However, if I run mount -a after boot up, it mounts everything just fine.

Here's what my fstab looks like. Ignore the commented ones... I just did a few for testing purposes right now.

//192.168.1.97/media /mnt/samba cifs credentials=/home/xbmc/.smbcredentials,rw,file_mode=0777,dir_mode=0777,sec=ntlm,auto 0 0
#//192.168.1.97/media/TV\040Shows /home/xbmc/TV\040Shows cifs credentials=/home/xbmc/.smbcredentials,rw,file_mode=0777,dir_mode=0777,sec=ntlm,auto 
//192.168.1.97/media/Movies /home/xbmc/Movies cifs credentials=/home/xbmc/.smbcredentials,rw,file_mode=0777,dir_mode=0777,sec=ntlm,auto 0 0
//192.168.1.97/media/Music /home/xbmc/Music cifs credentials=/home/xbmc/.smbcredentials,rw,file_mode=0777,dir_mode=0777,sec=ntlm,auto 0 0
#//192.168.1.97/media/3\040-\040My\040Pictures /home/xbmc/Pictures cifs credentials=/home/xbmc/.smbcredentials,rw,file_mode=0777,dir_mode=0777,sec=ntlm,auto
#//192.168.1.97/media/XBMC /home/xbmc/Admin cifs credentials=/home/xbmc/.smbcredentials,rw,file_mode=0777,dir_mode=0777,sec=ntlm,auto

Have seen a few things on the internet where it was believed its because the share isn't available yet (i.e. wifi not connected yet, etc) when it's attempting to mount.

  1. Is there anyway to confirm that's the problem,
  2. IF so, is there a solution? Is there some way to put a delay in fstab? Or how might i write a script to run mount -a a certain amount of time after boot?

Found the option _netdev from a little research, included that in fstab but still the same result.

share|improve this question

3 Answers 3

Try to add _netdev (with the underscore) to the options. For example the first line in your fstab becomes:

//192.168.1.97/media /mnt/samba cifs credentials=/home/xbmc/.smbcredentials,rw,_netdev,file_mode=0777,dir_mode=0777,sec=ntlm,auto 0 0

According to the manpage of mount this will delay mounting until the network is up.

share|improve this answer
    
OP said it doesn't work. –  Braiam May 21 at 17:47

Well, I guess here is the workaround I applied.

sudo nano /etc/network/if-up.d/fstab

#/bin/sh
mount -a

sudo chmod +x /etc/network/if-up.d/fstab

I don't think it's a very elegant solution... I'm pretty much a complete linux noob so if someone has something better... I guess there are always many ways to do anything.

share|improve this answer

I had the same problem with my two media hard drives when I was setting up my Ubuntu system. This is what I had to do to get them auto-mounted (all done from terminal):

  1. Made a backup of the fstab file - "sudo cp /etc/fstab /etc/fstab.bak"
  2. Had to get the UUID of each drive I wanted to auto-mount "sudo blkid"
  3. Opened up the fstab file to do some editing - "sudo nano /etc/fstab"
  4. Added the following line to the end of the file for each hard drive I wanted to auto-mount - "uuid=UID PATHMOUNT FILESYSTEM uid=1000,gid=1000,umask=0022,sync,auto,rw 0 0"
    • !-!-EXAMPLE-!-! - UUID=3087106951A1FA7A /media/Z-Movies-1TB ntfs uid=1000,gid=1000,umask=0022,sync,auto,rw 0 0
  5. Saved the fstab file.
  6. Reboot the computer.
share|improve this answer
    
I found what i was doing was causing a a mountall: disconnected from plymouth error which would crash the system. It seemed that if fstab attempted to mount those shares when they weren't available yet, it would eventually cause this error. If I didn't have the entries in fstab, then added them after boot, then did a mount -a, it would work fine. I will give it a try with the UUID and see if it makes a difference! –  kelvin Nov 8 '13 at 21:02

Your Answer

 
discard

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.