network drive mount - #mount works, fstab fails

I have a linkstation on my home network. Shared folder called “linux_backup” with no userid or password required.

In OpenSUSE 10.2 if I go to ‘my computer’ and surf to the network drives, I see this folder with no problem and I can open it and add files:

smb://linkstation/linux_backup

If I use the mount command, I can mount this network drive and use it, with no problem.

However, if I add the following to fstab:

//192.68.1.15/linux_backup /home/chuck/backup cifs username=,password=,_netdev,uid=chuck,gid=users 0 0

when I go to open the folder I get the message “permission denied”.

Any ideas how I can fix this?

Thanks…

What mount command do you use?

chuckcintron wrote:
> I have a linkstation on my home network. Shared folder called
> “linux_backup” with no userid or password required.
>
> In OpenSUSE 10.2 if I go to ‘my computer’ and surf to the network
> drives, I see this folder with no problem and I can open it and add
> files:
>
> SMB://LINKSTATION/LINUX_BACKUP
>
> If I use the mount command, I can mount this network drive and use
> it, with no problem.
>
> However, if I add the following to fstab:
>
> //192.68.1.15/LINUX_BACKUP /HOME/CHUCK/BACKUP CIFS
> USERNAME=,PASSWORD=,_NETDEV,UID=CHUCK,GID=USERS 0 0
>
> when I go to open the folder I get the message “permission denied”.

You’re not supposed to put that into /etc/fstab, but
/etc/samba/smbfstab. It has a slightly different format regaring the
zeros at the end. Read the comments on the top.

Note that GNU/Linux is case sensitive, so the above in capitals may
simply not work syntactically.

Finally, openSUSE 10.2 is out of support, you need to upgrade now.

Kind regards,
Andreas Stieger

It’s OK to use the cifs filesystem to mount/map a widows share using fstab.
Of course, it’s OK to use smbfstab too.
10.2 supports cifs mounts.

This is a line from an fstab I use to mount partitions of a Windows2000 server:

//192.168.1.4/XXX /mnt/XX/XXX cifs iocharset=iso8859-15,uid=1000,gid=100,rw,workgroup=GRAND,file_mode=0664,dir_mode=0775,user=admin,password=XXXXX 0 0

This partition is mounted during boot.

I have the same issue:
Mounts OK:

mount -t cifs -o username=xxx,password=xxx //server/share /home/_tmp/smb

In fstab:

//server/share /home/_tmp/smb cifs username=xxx,password=xxx 0 0
mount -a
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

Also kde4-smb4k freezes when I select share to mount :frowning:

Yes, I have the same problem as Bolick, above. The mount command works, but using fstab fails.

I next tried to use smbfstab, instead of fstab (per Andreas suggestion). Here is what I have in smbfstab:

//192.168.1.15/linux_backup /linux_backup cifs username=,password=

I stopped then restarted the smb service, and was happy to see a return code of zero with an indication that it did process that new line in smbfstab. But then I went to the console to try to find my new /linux_backup directory – and I can’t find it anywhere.

So, if I got a zero return code from smb does that mean it worked? And if it did work, how do I now access the directory?

Knurpht, I did try your syntax as well…it did map the directory but I get the same “permission denied” error as my own attempt with fstab.

Problem solved. I messed around with a couple of things, so I’m not sure exactly what did it. One thing for sure, I didn’t realize that the target directory for the map has to exist already on the linux machine.

So,first: mkdir /home/linux_backup and chmod 777

then, modified fstab to this:

//192.168.1.15/linux_backup /home/linux_backup cifs username=chuck,password=chuckpw,_netdev,file_mode=0777,dir_mode=0777 0 0

also, it seems like it wants to have a carriage return after the last line in fstab, so make sure you hit enter after those two zeros.

Anyway, it works great now…survives mounting between reboots and my Linkstation is now a virtual folder for backing up my Linux box (which will now be the next exercise to figure out).

BTW, this is a ubuntu page but it was very helpful:

Mounting Windows SMB File Shares Using Cifs > thatsquality.com

swerdna wrote:
> AndreasStieger;1962263 Wrote:
>> You’re not supposed to put that into /etc/fstab, but
>> /etc/samba/smbfstab. It has a slightly different format regaring the
>> zeros at the end. Read the comments on the top.
>
> It’s OK to use the cifs filesystem to mount/map a widows share using
> fstab.
> Of course, it’s OK to use smbfstab too.
> 10.2 supports cifs mounts.

fstab is world readable while /etc/samba/smbfstab is not, hence any cifs
mounts with username/password have no business in /etc/fstab. And none
of the others either so users don’t build a habit. :slight_smile:

Kind regards,
Andreas Stieger

Andreas, this is a guest-accessed share. It’s OK to use fstab for that because the creds are simply to use the option “password=”

So in summary:
It’s OK to put a cifs mount in fstab if you do one of three things (IIRC):

  • use the “credentials” option and place the creds in a file that has been chmod-ed to 600 [like the file smbfstab is chmoded to 600 in later versions of openSUSE].
  • chmod 600 the fstab file
  • use “password=” for guest-accessed shares like the one discussed here

Finally I’ve got it working. Fuf…
The point was domain!
After I added

domain=MYDOMAIN

to fstab string it starts to mount.

The strangest thing that manual mount was OK even with

username=MYDOMAIN\\USERNAME

But in fstab I had to put

username=USERNAME,password=PASSWORD,domain=MYDOMAIN

Very strange behavior!

swerdna could you please add this point to your smb mount manual. I mean this situation when share is in domain.

Thanks for your help anyway.

P.S. the real solution was in man on mount.cifs :slight_smile: