LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 09-03-2008, 04:46 PM   #1
keyboard1973
Member
 
Registered: Jun 2008
Posts: 52

Rep: Reputation: 15
mount samba share at boot with fstab


Hello,

I am trying to use fstab to mount my samba share at bootup from one linux box to another. Both linux distro's are centos 5. This is what I entered in my fstab file,

//192.168.2.101/backup /home/keith/backup ext3 /home/keith/.smbcredentials,UID=500,dmask=700,fmask=700

This is the error I receive when I type mount -a to check

[root@laptop keith]# mount -a
mount: special device //192.168.2.101/backup does not exist

The backup share is there, I can mount it manually with

mount -o smbfs -o username="username" //192.168.2.101/backup /mnt/smbshare

I have 2 different mount points I created, on is backup and the other is smbshare. Any help or suggestions would be appreciated. I don't know if the credential file is the issue. The .smbcredential is located in my user home directory and I chown the file to root:root.

Thanks again,

Keith
 
Old 09-03-2008, 06:54 PM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Code:
//192.168.2.101/backup /home/keith/backup ext3 /home/keith/.smbcredentials,UID=500,dmask=700,fmask=700
The mount command will call mount.cifs to perform the mounting. There are more cifs specific mount options given in the "man mount.cifs" man page.
Code:
//192.168.2.101/backup /home/keith/backup cifs credentials=/home/keith/.smbcredentials,_netdev,UID=500,dir_mode=700,file_mode=700
Use cifs instead of smbfs. You are using "ext3" which is wrong. Use "credentials=/home/keith/.smbcredentials" instead so your credentials information isn't listed in /etc/fstab. Also use the "_netdev" option so that if the server at 192.168.2.101 isn't available when you boot, mounting the share is backgrounded so that the boot process can continue. You could also use the "noauto" option and put a mount command in your ~/.profile file. Then the share will be mounted when you log in.

Firstly, smbfs is obsolete and no longer supported. Newer kernels don't support it.
Cifs has better Linux <-> Linux support. Even attributes and file acls work (setfacl, getfacl, etc). the "file_mode" and "dir_mode" options are the defaults if the server doesn't support the cifs protocol and the smb protocol is used as a fall back. Otherwise, your own umask value is used, just as it would be had you been using nfs or a local directory.

Also check which ports are open on the server. If you see these you are OK.
nmap 192.168.2.101
Code:
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
Check if the smbd daemon is running of the server.

Last edited by jschiwal; 09-03-2008 at 07:05 PM.
 
Old 09-04-2008, 02:27 PM   #3
keyboard1973
Member
 
Registered: Jun 2008
Posts: 52

Original Poster
Rep: Reputation: 15
Cifs

Thank you for sharing all this information with me. I was not aware of cifs being more supported then smbfs. The code you posted worked like a charm, the ports in question are open. I am going to read more about what you listed.

Thanks again

Keith
 
  


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
how to mount samba share only when connected - at boot? adamruss Linux - Networking 1 08-21-2008 11:17 AM
Can't mount nfs share from fstab but can mount it manually - help Mountain Linux - Networking 1 03-30-2008 08:34 PM
Mount samba share at boot with user write permissions Wynd Linux - Software 2 08-21-2006 11:48 PM
FSTAB: My Win Share Wont Mount @ Boot, but will when I sudo mount -a...please help! TruANTOlogy Ubuntu 8 06-20-2006 08:00 AM
samba share mount on boot anthjaz Linux - Software 4 11-04-2003 04:56 PM


All times are GMT -5. The time now is 10:39 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