-   Linux - Newbie (
-   -   cifs mount & fstab entries (

JeffC1 05-13-2009 04:41 PM

cifs mount & fstab entries
I've used the following mount

mount -t cifs -o credentials=/scripts/smbmount.credentials,gid=500,rw,file_mode=0770,dir_mode=0770 //server/shares/ /file/shares/

My questions are this

1) What FSTAB entry should I create?

2) Are there any options that would help keep this connection "alive and stable"? its being shared via SAMBA.

JeffC1 05-13-2009 06:28 PM

Im having trouble unmounting the share using umount //share/name/ and umount.cifs. neither work. kick back a device in use error. I also tried -f

Tinkster 05-13-2009 06:33 PM

Are any session/processes accessing files on that share?

JeffC1 05-13-2009 08:15 PM

No. I even shut down samba. Seems strange but maybe i'm just not doing it right.

chrism01 05-13-2009 08:23 PM

If you have mounted that share from the server to your client (ie where you are logged in) then you can't umount it if any process at all is using that mount, including if your current working dir (pwd) ie where you are, is on that mount. You have to cd elsewhere.
Otherwise check lsof, fuser.

JeffC1 05-13-2009 08:59 PM

What is the proper syntax to unmount?

JeffC1 05-13-2009 09:21 PM

[root@~]# umount.cifs -f //server/shares
This utility only unmounts cifs filesystems.

umount -f //server/shares

WORKED! I had to be out of the dir and samba shutdown.

If someone can look into the other two questions that would be great.

chrism01 05-13-2009 09:30 PM

Well for fstab something like

//server/shares/ /file/shares/ cifs user=smbmount,gid=500,rw,soft 0 0
basically what you had, plus the 2 zeroes (you don't need to worry about them)
As for 'stable', there's no option for that, you just have to keep your systems/network stable, like any other service.

JeffC1 05-13-2009 09:36 PM

Im mounted the file system a different way using

mount -t cifs -o credentials=/scripts/smbmount.credentials,gid=500,rw,file_mode=0770,dir_mode=0770 //server/shares/ /file/shares/

How would this affect the fstab entry? Why is the syntax so different between fstab and mounting?

JeffC1 05-13-2009 09:37 PM

ps: thank you

chrism01 05-13-2009 09:40 PM

Actually, the easiest way is to

cat /etc/mtab

after you've done the manual mount. You can pretty much cut 'n paste the relevant line into /etc/fstab.
The system knows how to mount stuff, that's why the manual cmd is different, the system only needs to be told what to mount, where and any options.
PS do NOT edit /etc/mtab(!)

JeffC1 05-13-2009 09:56 PM

Ah thank you very much.

JeffC1 05-13-2009 10:04 PM


I copied and pasted the info

The options in mtab are cifs rw,mand 0 0

Should I manually add gid=500,rw,file_mode=0770,dir_mode=0770,soft ?

chrism01 05-14-2009 01:19 AM

If you want to... depends on what works for you.

JeffC1 05-14-2009 09:56 AM


How can i tell if these options were applied to the original mount?

gid=500,rw,file_mode=0770,dir_mode=0770,soft ?

All times are GMT -5. The time now is 02:40 PM.