[PVE-User] autofs cifs mounts in proxmox - any success?

Fred Supinski fred at vmu.ca
Tue Dec 22 22:51:32 CET 2009


Hi,

I have been having a few issues getting autofs to mount samba shares in
proxmox.

Has anyone had any successes?

I originally followed the tutorial at
http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs

The following happens when I try to access the share:
vm0:/etc# cd /cifs/10.0.0.40/0.data.vmbk/
-bash: cd: /cifs/10.0.0.40/0.data.vmbk/: No such file or directory

This is the tail from the syslog:
vm0:/etc# tail /var/log/syslog
Dec 22 16:07:33 vm0 automount[7593]: lookup(program): lookup for
10.0.0.40 failed
Dec 22 16:07:33 vm0 automount[7593]: failed to mount /cifs/10.0.0.40
Dec 22 16:07:33 vm0 automount[7596]: lookup(program): lookup for
10.0.0.40 failed
Dec 22 16:07:33 vm0 automount[7596]: failed to mount /cifs/10.0.0.40
Dec 22 16:07:33 vm0 automount[7598]: lookup(program): lookup for
10.0.0.40 failed
Dec 22 16:07:33 vm0 automount[7598]: failed to mount /cifs/10.0.0.40

Any help with resolving this is appreciated.

Below you will find additional information which may be relevant.

Thank you,

Fred Supinski


Current permissions on the relevant files:
vm0:/etc# ls -l | grep auto
-rwxr-xr-x 1 root root     1419 Dec 22 15:43 auto.cifs
-rwxr-xr-x 1 root root      379 Dec 22 15:53 auto.master
-rw-r--r-- 1 root root      581 Mar  8  2008 auto.misc
-rwxr-xr-x 1 root root     1310 Mar  8  2008 auto.net
-rwxr-xr-x 1 root root      737 Mar  8  2008 auto.smb
-rw------- 1 root root       51 Dec 22 15:03 auto.smb.10.0.0.40    # I
have also tried with 644 here

Some of the file contents:

vm0:/etc# nano auto.cifs
#\!/bin/bash
#
# Stolen from
http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs
and fixed up
# a bit.
# This file must be executable to work! chmod 755!
key="$1"
#
# To mount server named 'vader' with a username of 'bob' and a password
of '4b0b',
# create a file called /etc/auto.cifs.vader containing
# username=bob
# password=40b
#
# This file should have permissions of 600, by running 'chmod 600
/etc/auto.cifs.vader'
#
# SMB mounts tend to work better if you map them to a real user, change
the uid and gid
# here.
MOUNT_UID=0
MOUNT_GID=0
#
credfile="/etc/auto.smb.$key"
# Note: Use cifs instead of smbfs:
mountopts="-fstype=cifs,file_mode=0644,dir_mode=0755,uid=${MOUNT_UID},gid=${MOUNT_GID}"
smbclientopts=""
for P in /bin /sbin /usr/bin /usr/sbin
do
        if [ -x $P/smbclient ]
        then
                SMBCLIENT=$P/smbclient
                break
        fi
done
[ -x $SMBCLIENT ] || exit 1
if [ -e "$credfile" ]
then
        mountopts=$mountopts",credentials=$credfile"
        smbclientopts="-A "$credfile
else
        smbclientopts="-N"
fi
$SMBCLIENT $smbclientopts -gL $key 2>/dev/null \
   | awk -v key="$key" -v opts="$mountopts" -F'|' -- '
        BEGIN   { ORS=""; first=1 }
        /Disk/  { if (first) { print opts; first=0 };
                  sub(/ /, "\\ ", $2);
                  print " \\\n\t /" $2, "://" key "/" $2 }
        END     { if (!first) print "\n"; else exit 1 }
        '



vm0:/etc# nano auto.master
#
# 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
/cifs /etc/auto.cifs --timeout=60

#this one was edited to maintain format but hide secrets.
vm0:/etc# nano auto.smb.10.0.0.40
username=domain/user
password=secret
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.proxmox.com/pipermail/pve-user/attachments/20091222/f106d0e9/attachment.htm>


More information about the pve-user mailing list