LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-13-2009, 03:41 PM   #1
JeffC1
Member
 
Registered: May 2008
Posts: 89

Rep: Reputation: 15
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.

Last edited by JeffC1; 05-13-2009 at 08:36 PM.
 
Old 05-13-2009, 05:28 PM   #2
JeffC1
Member
 
Registered: May 2008
Posts: 89

Original Poster
Rep: Reputation: 15
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
 
Old 05-13-2009, 05:33 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,983
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Are any session/processes accessing files on that share?
 
Old 05-13-2009, 07:15 PM   #4
JeffC1
Member
 
Registered: May 2008
Posts: 89

Original Poster
Rep: Reputation: 15
No. I even shut down samba. Seems strange but maybe i'm just not doing it right.
 
Old 05-13-2009, 07:23 PM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,287

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
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.
 
Old 05-13-2009, 07:59 PM   #6
JeffC1
Member
 
Registered: May 2008
Posts: 89

Original Poster
Rep: Reputation: 15
What is the proper syntax to unmount?
 
Old 05-13-2009, 08:21 PM   #7
JeffC1
Member
 
Registered: May 2008
Posts: 89

Original Poster
Rep: Reputation: 15
[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.
 
Old 05-13-2009, 08:30 PM   #8
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,287

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
Well for fstab something like
Code:
//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.
 
Old 05-13-2009, 08:36 PM   #9
JeffC1
Member
 
Registered: May 2008
Posts: 89

Original Poster
Rep: Reputation: 15
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?
 
Old 05-13-2009, 08:37 PM   #10
JeffC1
Member
 
Registered: May 2008
Posts: 89

Original Poster
Rep: Reputation: 15
ps: thank you
 
Old 05-13-2009, 08:40 PM   #11
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,287

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
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(!)
 
Old 05-13-2009, 08:56 PM   #12
JeffC1
Member
 
Registered: May 2008
Posts: 89

Original Poster
Rep: Reputation: 15
Ah thank you very much.
 
Old 05-13-2009, 09:04 PM   #13
JeffC1
Member
 
Registered: May 2008
Posts: 89

Original Poster
Rep: Reputation: 15
Chris:

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 ?
 
Old 05-14-2009, 12:19 AM   #14
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,287

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
If you want to... depends on what works for you.
 
Old 05-14-2009, 08:56 AM   #15
JeffC1
Member
 
Registered: May 2008
Posts: 89

Original Poster
Rep: Reputation: 15
Chris,

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


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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cifs "mount error 13 = Permission denied" CIFS SUCKS humbletech99 Linux - Networking 40 10-31-2012 08:50 AM
NFS entries in /etc/fstab fail to mount on bootup in Mandriva 2009 dickgregory Mandriva 5 10-16-2008 08:14 AM
cifs mount in fstab help nitrohuffer2001 Linux - Software 1 04-22-2007 05:09 PM
Network fstab entries don't mount at boot tisource Linux - Networking 7 12-29-2005 06:54 PM


All times are GMT -5. The time now is 08:14 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration