<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Verdana">Hi,<br>
<br>
I have been having a few issues getting autofs to mount samba shares in
proxmox.<br>
<br>
Has anyone had any successes?<br>
<br>
I originally followed the tutorial at
<a class="moz-txt-link-freetext" href="http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs">http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs</a><br>
<br>
The following happens when I try to access the share:<br>
vm0:/etc# cd /cifs/10.0.0.40/0.data.vmbk/<br>
-bash: cd: /cifs/10.0.0.40/0.data.vmbk/: No such file or directory<br>
<br>
This is the tail from the syslog:<br>
vm0:/etc# tail /var/log/syslog<br>
Dec 22 16:07:33 vm0 automount[7593]: lookup(program): lookup for
10.0.0.40 failed<br>
Dec 22 16:07:33 vm0 automount[7593]: failed to mount /cifs/10.0.0.40<br>
Dec 22 16:07:33 vm0 automount[7596]: lookup(program): lookup for
10.0.0.40 failed<br>
Dec 22 16:07:33 vm0 automount[7596]: failed to mount /cifs/10.0.0.40<br>
Dec 22 16:07:33 vm0 automount[7598]: lookup(program): lookup for
10.0.0.40 failed<br>
Dec 22 16:07:33 vm0 automount[7598]: failed to mount /cifs/10.0.0.40<br>
<br>
Any help with resolving this is appreciated.<br>
<br>
Below you will find additional information which may be relevant.<br>
<br>
Thank you,<br>
<br>
Fred Supinski<br>
<br>
<br>
Current permissions on the relevant files: <br>
vm0:/etc# ls -l | grep auto<br>
-rwxr-xr-x 1 root root     1419 Dec 22 15:43 auto.cifs<br>
-rwxr-xr-x 1 root root      379 Dec 22 15:53 auto.master<br>
-rw-r--r-- 1 root root      581 Mar  8  2008 auto.misc<br>
-rwxr-xr-x 1 root root     1310 Mar  8  2008 auto.net<br>
-rwxr-xr-x 1 root root      737 Mar  8  2008 auto.smb<br>
-rw------- 1 root root       51 Dec 22 15:03 auto.smb.10.0.0.40    # I
have also tried with 644 here<br>
<br>
Some of the file contents:<br>
<br>
vm0:/etc# nano auto.cifs<br>
#\!/bin/bash<br>
#<br>
# Stolen from
<a class="moz-txt-link-freetext" href="http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs">http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs</a>
and fixed up<br>
# a bit.<br>
# This file must be executable to work! chmod 755!<br>
key="$1"<br>
#<br>
# To mount server named 'vader' with a username of 'bob' and a password
of '4b0b',<br>
# create a file called /etc/auto.cifs.vader containing<br>
# username=bob<br>
# password=40b<br>
#<br>
# This file should have permissions of 600, by running 'chmod 600
/etc/auto.cifs.vader'<br>
#<br>
# SMB mounts tend to work better if you map them to a real user, change
the uid and gid<br>
# here.<br>
MOUNT_UID=0<br>
MOUNT_GID=0<br>
#<br>
credfile="/etc/auto.smb.$key"<br>
# Note: Use cifs instead of smbfs:<br>
mountopts="-fstype=cifs,file_mode=0644,dir_mode=0755,uid=${MOUNT_UID},gid=${MOUNT_GID}"<br>
smbclientopts=""<br>
for P in /bin /sbin /usr/bin /usr/sbin<br>
do<br>
        if [ -x $P/smbclient ]<br>
        then<br>
                SMBCLIENT=$P/smbclient<br>
                break<br>
        fi<br>
done<br>
[ -x $SMBCLIENT ] || exit 1<br>
if [ -e "$credfile" ]<br>
then<br>
        mountopts=$mountopts",credentials=$credfile"<br>
        smbclientopts="-A "$credfile<br>
else<br>
        smbclientopts="-N"<br>
fi<br>
$SMBCLIENT $smbclientopts -gL $key 2>/dev/null \<br>
   | awk -v key="$key" -v opts="$mountopts" -F'|' -- '<br>
        BEGIN   { ORS=""; first=1 }<br>
        /Disk/  { if (first) { print opts; first=0 };<br>
                  sub(/ /, "\\ ", $2);<br>
                  print " \\\n\t /" $2, "://" key "/" $2 }<br>
        END     { if (!first) print "\n"; else exit 1 }<br>
        '<br>
<br>
<br>
<br>
vm0:/etc# nano auto.master<br>
#<br>
# Sample auto.master file<br>
# This is an automounter map and it has the following format<br>
# key [ -mount-options-separated-by-comma ] location<br>
# For details of the format look at autofs(5).<br>
#/misc  /etc/auto.misc --timeout=60<br>
#/smb   /etc/auto.smb<br>
#/misc  /etc/auto.misc<br>
#/net   /etc/auto.net<br>
/cifs /etc/auto.cifs --timeout=60<br>
<br>
#this one was edited to maintain format but hide secrets.<br>
vm0:/etc# nano auto.smb.10.0.0.40<br>
username=domain/user<br>
password=secret<br>
</font></font>
</body>
</html>