LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Mounting Samba share with fstab (https://www.linuxquestions.org/questions/linux-server-73/mounting-samba-share-with-fstab-671235/)

icarus127 09-20-2008 11:01 AM

Mounting Samba share with fstab
 
Hi all,
I'm trying to set up a Buffalo Pro Duo NAS drive to be user mountable via an fstab entry. I can mount and use it perfectly with:

Code:

mount -t cifs -o guest //192.168.0.194/krayNetDrive /X:
However no matter what I put in the fstab entry I get this
Code:

icarus@daedalus:~$ mount /X:/
mount error 1 = Operation not permitted
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

My fstab entry currently looks like this:

Code:

//192.168.0.194/krayNetDrive /X:  cifs guest,noauto,user,umask=000    0  0
If I take away the guest option I get a password prompt which gives me the abover error if I leave it blank, put in the admin password for the NAS or the password for the one user I have setup.

If I put in the username = icarus I get a password prompt that gives the same behavior.

I've tried removing the umask option thinking that maybe I can't set a umask for a samba share, but that doesn't change my results. Can anyone tell me where I'm going wrong?

As an aside, is there any way to suppress the error messages about not being able to maintain file permissions when I copy stuff onto the NAS?
It's not that annoying when using command line tools, but when I'm melding a file tree onto the NAS and Meld gives me a prompt for every single file it's incredibly frustrating. I can't find an option in meld for this, will any of the share options do this?

Thanks in advance.

CRC123 09-20-2008 12:02 PM

try doing it as root

icarus127 09-26-2008 09:51 AM

When I try it as root it works perfectly. Does that tell you anything?

The users option in the fstab allows me to try to mount it as a user, but apparently cifs is not getting the right options. I can't find anything in the specified man page that sheds any light on the subject. I've tried a bunch of the options, sec=none, guest, user=guest, etc. with no effect.

Anyone have any more suggestions?

Chromezero 09-26-2008 10:05 AM

Give this a shot
Code:

//192.168.0.194/krayNetDrive /X:  cifs noauto,username=icarus    0  0
This will prompt you for a password for icarus. However, the password is not the password on the local machine. It will be the password on the remote machine, the samba account for icarus. You might also try changing icarus to guest, if that worked when manually mounting it. You can also add the password to the fstab entry to avoid manually typing this each time, although this may not be the most secure approach.

icarus127 09-26-2008 11:26 AM

That won't allow me to mount it except as root. If I add the users option I get the same error with either icarus or guest as the username, operation not permitted.

Chromezero 09-30-2008 09:46 AM

Sorry for the delayed response, been busy the past few days. Anyway,this sounds like a permissions issue to me. You may want to do an ls -l on /sbin/mount.cifs and find out what group/permissions are set on the mount command. Chances are, this is set to root/root. You could setup a samba group and add yourself, and anyone else you need, to the samba group. Then change /sbin/mount.cifs to root/samba with permissions of 750 or something similar. Then anyone that's part of the samba group should be able to execute that command.

icarus127 10-01-2008 09:51 PM

I checked the file permissions all the way down the tree. mount.cifs, and the link to it which is used in the path, have permissions 755 or higher. All the directories in the paths leading to the link and the actual binary are set with permissions 755.
As far as I can tell all the permissions should allow normal users to use mount.cifs. Also, I'm not sure if this matters or not, but I set the permissions of the mount point itself to allow all users rwx access.

Thanks for the suggestion, does anything else come to mind?

Chromezero 10-02-2008 01:58 PM

Honestly, I'm out of ideas here. At this point all I can suggest is to double check everything: smb.conf on the remote machine, samba user accounts on the remote machine, fstab on the local machine, mount point on the local machine. If root is able to mount this successfully and users can not, it just seems like a permissions issue to me...

icarus127 10-03-2008 12:07 AM

I don't think it's a permissions issue at the OS level because the error doesn't seem to be coming from the OS. It seems that I have permission to executre mount.cifs, but when I do the application itself is saying I'm not permitted to do something. I guess I need to do more digging into what mount.cifs actually needs.


All times are GMT -5. The time now is 09:57 AM.