Mounting NAS using cifs at startup problem, help!

Mounting NAS using cifs at startup problem

Hi Everyone,

I’m trying to mount a network drive at startup so I can have access to my remotely stored music. I know there are other detailed threads on this and I’ve read them and followed the instructions but I’m still unable to get it to work. This is the situation so far:

  • I’m using Suse 11.1 64 bit on my samsung q310 laptop

  • I want to connect to a QNAP NAS that lives on my network

  • I can connect manually from the command line using:

    mount -t cifs -o username=admin,password=myPassword // /home/Ross/Music

    which works fine, great but I want it to happen automatically at start up…

  • So I edited the /etc/fstab file to include the line:

    Ross@linux-nmxz:/etc> cat fstab
    /dev/disk/by-id/ata-FUJITSU_MHY2250BH_K42XT8726WWD-part5 swap swap defaults 0 0
    /dev/disk/by-id/ata-FUJITSU_MHY2250BH_K42XT8726WWD-part6 / ext3 acl,user_xattr 1 1
    /dev/disk/by-id/ata-FUJITSU_MHY2250BH_K42XT8726WWD-part7 /home ext3 acl,user_xattr 1 2
    /dev/disk/by-id/ata-FUJITSU_MHY2250BH_K42XT8726WWD-part2 /windows/C ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
    /dev/disk/by-id/ata-FUJITSU_MHY2250BH_K42XT8726WWD-part3 /windows/D ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
    proc /proc proc defaults 0 0
    sysfs /sys sysfs noauto 0 0
    debugfs /sys/kernel/debug debugfs noauto 0 0
    usbfs /proc/bus/usb usbfs noauto 0 0
    devpts /dev/pts devpts mode=0620,gid=5 0 0
    // /mnt/Music cifs username=admin,password=myPassword,_netdev 0 0

  • Still no luck with this working at startup but thought that it could just be that the computer is slow connecting to the network, so…

  • I edited the crontab, I haven’t done this before so I:

    • Logged in as su from the terminal
    • typed: crontab -e
    • looks like there was no file set up so I think it set up a new one? Anyway, I added the following line so the file looks like this:

    @reboot sleep 30;mount -a

    • That’s all that’s in the file, nothing else…
  • I’ve now rebooted several times but still no luck and I’m out of ideas…

  • Can anyone suggest what else I should be checking? Or how to go about further diagnosing the issue?? Any help appreciated!

Thanks everyone!!

The line in fstab mounts the Public folder with everything in it in /mnt/Music. Boot with the line in fstab, open a terminal window and do:
su -c ‘mount /mnt/Music’
Enter root password when asked for, copy and paste output here.

If you want it mounted like in your manual successful attempt, change the line to:
// /home/Ross/Music cifs username=admin,password=myPassword,_netdev 0 0

Did you try removing the _netdev option ?

And…if you wrote the line in a file ‘CRONTEST’, did you perform a:
su -c ‘crontab CRONTEST’
If not, cron does not know it has to execute the command

Hope this helps you

As Knurpht already says, you really can not say that mounting manualy:

mount -t cifs -o username=admin,password=myPassword // /home/Ross/Music

and as specified in your /etc/fstab:

// /mnt/Music cifs username=admin,password=myPassword,_netdev 0 0

should have the same result as they are different in several points:
. different mount point;
. different options.
Please do first decide what you want and test that before your are using crontab, etc.

You can see what is mounted where by e.g.