fstab not mounting cifs share at boot

CAB_123 used Ask the Experts™

I'm getting very frustrated and need a little help. I'm using Fedora 16 and can't seem to get a Samba share to mount at boot with fstab.

Here is my line in fstab.

//192.168.2.x/RAID  /gateway            cifs    username=xxxxx,password=,_netdev        0 0

yet if I run 'mount -av' it mounts.

bash-4.2# mount -av
mount: UUID=9f47b0b5-7b59-4183-9372-ebe52b7833ed already mounted on /boot
mount: /dev/mapper/VolGroup-lv_home already mounted on /home
//192.168.2.x/RAID on /gateway type cifs (rw,_netdev,username=xxxxx,password=)

I'm using _netdev so it should not be mounting until after the network is up so I am clueless.....

Thank you for any insight you can give.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Duncan RoeSoftware Developer

You need to ensure there is a second _netdev mount during the boot sequence, which must be done after samba has started.
There may or may not be a standard script for this. If not, your script should issue mount -a -O _netdev for the start option, and the same except umount for the stop option.
President, IT4SOHO, LLC
duncan_roe is correct in that the mount has to complete later in the boot process, but I don't think there is a dependency on the samba services, as you're acting as a client, not a server (assuming that the 192.168.2.x address is a separate device).

Never the less, unless there was a compelling reason otherwise, I would simply add a line to your S99local script:

mount -a
This will finish any mounts (silently) at the end of the startup process...

There is no need to create a K script, as the standard unmounting will happen at the appropriate times during shutdown.

As with anything Linux, there are a limited number of ways to do things -- typically only about 100 or so for each thing you hope to accomplish.

I hope this helps!


FWIW: I tend to NOT LIKE having SMB shares mounted in my Linux system "permanently" as there are issues (unless you're sure you're running SMB 2.0 -- e.g. Vista, 7, 2008, or equivalent... no XP, no 2003). Instead, when I need for SMB shared files to be available, I set them up as AUTOMOUNT folders... that way, I maintain the SMB share while I need it, and tear it down when its not needed.
You could also try adding the noauto option to mount it during login instead of during boot.  It might just be timing out during boot if the network hadn't fully started yet.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial