On Fri, 2006-12-22 at 12:16 +0000, Frank Murphy wrote:
> Want to automount at boot my samba shares on my FC6 server. (my home lan)
> 
> Is it fstab I modify?, or where to start?
> 

Now this is for my laptop.  I'm the only one useing it, so this is kind
of for a single user.

Start my editing /etc/auto.master and un comment the 

#
# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#/misc  /etc/auto.misc --timeout=60
#/smb   /etc/auto.smb
#/misc  /etc/auto.misc
#/net   /etc/auto.net

/smb line.

Then for me I had to change the auto.smb with the following patch

[bpm]$ diff -wruN auto.smb /etc/auto.smb 
--- auto.smb    2006-12-22 08:38:31.000000000 -0600
+++ /etc/auto.smb       2006-08-09 09:55:39.000000000 -0500
@@ -5,7 +5,7 @@
 # This file must be executable to work! chmod 755!
 
 key="$1"
-opts="-fstype=smbfs"
+opts="-fstype=cifs,credentials=/home/bpm/.credentials,rw "
 
 for P in /bin /sbin /usr/bin /usr/sbin
 do
@@ -20,7 +20,7 @@
 
 $SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- '
        BEGIN   { ORS=""; first=1 }
-       /Disk/  { if (first) { print opts; first=0 }; print " \\\n\t /" $2, 
"://" key "/" $2 }
+       /Disk/  { if (first) { print opts; first=0 }; sub(/ /, "\\ ", $2); 
print " \\\n\t /" $2, "://" key "/" $2 }
        END     { if (!first) print "\n"; else exit 1 }
        '
 

the important change was changing the "opts" line and the "/Disk/" line

The credentials file is just a file with two lines:

username=XXXXX
password=ZZZZZ


The last thing to do is to make sure the autofs is working:
chkconfig autofs --list
autofs                    0:off  1:off  2:off  3:off  4:off  5:off  6:off

Turn it on with 
chkconfig autofs on


Read about cifs filetypes and the autofs system
-- 
Brian Millett - [ Matthew Stoner (to Garibaldi), "Soul Mates"]
"Hey, how about I call you an idiot in public and you can convict me
for revealing state secrets."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to