Sunday, April 1, 2007

OpenSUSE 10.2 - Mounting a CIFS Share on Boot

#*** Updated 13SEP2007 ***

//192.168.2.176/Disk-1 /mnt/Storage smbfs password=,fmask=770,dmask=770,gid=admin 0 0

I added the fmask and dmask (fmask for files, dmask for directories) to specify read/write permissions for the files and directories on the server share (only for owner and group, not guest). Also I specified a group id (gid) as admin which combined with the fmask/dmask gives any user in the admin group (as well as root, of course) read/write permissions to the server share. Damn that took a long time to figure out!

#End of update

Right when I thought I had tried everything I did something very simple to fix my enormously annoying boot-time fiasco. I had edited my /etc/fstab and put the following entry:

//192.168.15.5/Disk-1 /home/andrew/Storage cifs auto,password=,user,rw 0 0

Now according to everyone on the internet that I was able to find - this command in /etc/fstab should make my server share mount locally at boot. NOT. I couldn't figure out what the hell was wrong. It's been driving me nuts for weeks and I've tried everything everyone suggested.

Oh, let me also mention I knew my fstab entry was correct because whenever I ran sudo mount -a after boot-time it mounted just fine.

So then from what I read I came to the conclusion that my OpenSUSE machine was not connecting the my home network at boot - why could this be? Then I noticed that when it did boot into KDE it took a second to use the DHCP server to get an IP. So then I had this genius idea: give it a static IP address.

SO I DID!!! AND IT FIXED THE BLOODY PROBLEM!!!

Make sure if you're doing this to fix your problem you also set the default gateway or else you'll get no network connectivity. Phwew!!! Finally the battle is over!