mount network drive problem

Hi

I am a Linux beginner, this is the first time I installed it, so please be gentle with your answers :slight_smile:
I am using OpenSuse 11.2 with KDE.

I am trying to permanently mount a share on a network harddisk. I can mount it with the command

mount -t cifs //IPaddress/sharename -o password= /mnt/dir

after that the share is accessible in the specified dir.
But now I am trying to make this automatically happening at startup. For that I put the following line in fstab:

//IPaddress/sharename /mnt/dir cifs password=,_netdev,uid=linux_username,gid=users 0 0

But this doesnt work, the share is not mounted after startup, and mount -a also doesnt mount it, although there is also no error msg. Is there an obvious mistake in my fstab entry?

And a small side question: what command do I use to unmount something?

Thanks

Berth Hoffer wrote:
> Hi
>
> I am a Linux beginner, this is the first time I installed it, so please
> be gentle with your answers :slight_smile:
> I am using OpenSuse 11.2 with KDE.
>
> I am trying to permanently mount a share on a network harddisk. I can
> mount it with the command
>
> mount -t cifs //IPaddress/sharename -o password= /mnt/dir
>
> after that the share is accessible in the specified dir.
> But now I am trying to make this automatically happening at startup.
> For that I put the following line in fstab:
>
> //IPaddress/sharename /mnt/dir cifs
> password=,_netdev,uid=linux_username,gid=users 0 0
>
> But this doesnt work, the share is not mounted after startup, and mount
> -a also doesnt mount it, although there is also no error msg. Is there
> an obvious mistake in my fstab entry?

The line is fine, but you have the wrong file.
Use /etc/samba/smbfstab instead.
$sudo cat /etc/samba/smbfstab

This file allows you to mount SMB/ CIFS shares during system boot while

hiding passwords to other people than root.

>
> And a small side question: what command do I use to unmount something?

umount /mount/point

Theo

Does this work:

sudo mount -a

Hi
Thanks for the answers

LittleRedRooster:
Use /etc/samba/smbfstab instead.
this dir and this file dont exist on my installation.

swerdna:
sudo mount -a
this works. Does it mean I am doing something wrong with userrights?
Another thing I was wondering about: does Linux try to mount this share before the wireless connection is established? I am using KNetworkManager to connect, which starts at startup, but maybe the shares in fstab are started earlier? Although I thought thats what the _netdev command is for…?

That’s indeed what the _netdev command is for.

Unfortunately for a few years now the mount-at-boot of cifs via fstab (and also via smbfstab) is broken.

It’s such a required functionality for Linuxers who live in a world with windows that it makes me sake my head that it’s just left broken – but there it is.

The smbfs daemon (visible in the runlevels editor in Yast, and supposedly configurable there) is also broken.

That’s the problem. Here’s the workaround. You edit the root crontab and place this line into the table:

@reboot sleep 10;mount -a

and it should then work. That forces a 10 sec pause

More here: http://opensuse.swerdna.org/susecifs.html
and here: Cron Tables (Crontab) in Suse / openSUSE [Event Scheduler for 10.x, 11.x]

I found this guide which explains how to use autofs as an alternative means to mount samba shares. Not sure about pros vs cons, but interesting all the same.

Berth Hoffer wrote:
> Hi
> Thanks for the answers
>
> LittleRedRooster:
> Use /etc/samba/smbfstab instead.
> this dir and this file dont exist on my installation.

> $rpm -qf /etc/samba/smbfstab
samba-client-3.2.7-11.3.2

Theo