I followed the guide on this page to get samba shares working via autofs:http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofsServers and ConfigurationMy Samba server (remote) is on a server named mattserver (that's its Windows server name). It has four shares, called backup, matt, print, and web. The Samba client (local) is named bird.My setup is very similar to the examples in the aforementioned tutorial, except for some differences:/cifs /etc/auto.cifs --ghost instead of /cifs /etc/auto.cifs --timeout=60 in /etc/auto.masteruid=1000,gid=1000 instead of uid=user,gid=users in /etc/auto.cifsHere's my /etc/auto.master:matt@bird:~ $ cat /etc/auto.master/cifs /etc/auto.cifs --ghostHere's my /etc/auto.cifs:matt@bird:~ $ cat /etc/auto.cifs#!/bin/bashkey=$1credfile=/etc/auto.smb.$keymountopts=-fstype=cifs,file_mode=0644,dir_mode=0755,uid=1000,gid=1000smbclientopts=for P in /bin /sbin /usr/bin /usr/sbindo    if [ -x $P/smbclient ]        then        SMBCLIENT=$P/smbclient        break    fidone[ -x $SMBCLIENT ] || exit 1if [ -e $credfile ]then    mountopts=$mountopts,credentials=$credfile    smbclientopts=-A $credfileelse    smbclientopts=-Nfi$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 };        gsub(/ /, \\ , $2);        sub(/\$/, \\$, $2);        print  \\\n\t / $2, :// key / $2 }        END     { if (!first) print \n; else exit 1 }        'So here's what I get when I call /etc/auto.cifs directly:matt@bird:~ $ sudo bash /etc/auto.cifs mattserver-fstype=cifs,file_mode=0644,dir_mode=0755,uid=1000,gid=1000,credentials=/etc/auto.smb.mattserver \            /print\$ ://mattserver/print\$ \            /matt ://mattserver/matt \            /web ://mattserver/web \            /backup ://mattserver/backupSo far, so good, I think.TestingWhen I try to access the /cifs directory, I should get one directory called mattserver, right? I did put the --ghost option in there. I don't get anything though:matt@bird:~ $ ls -l /cifstotal 0When I access the server directory, I get a list of shares but it's screwed up:matt@bird:~ $ ls -l /cifs/mattserverls: cannot access /cifs/mattserver/web: No such file or directoryls: cannot access /cifs/mattserver/print$: No such file or directoryls: cannot access /cifs/mattserver/matt: No such file or directoryls: cannot access /cifs/mattserver/backup: No such file or directorytotal 0d????????? ? ? ? ?                ? backupd????????? ? ? ? ?                ? mattd????????? ? ? ? ?                ? print$d????????? ? ? ? ?                ? webWhen I try to access an actual share, I get nothing:matt@bird:~ $ ls -l /cifs/mattserver/webls: cannot access /cifs/mattserver/web: No such file or directoryAs a test, I added a line to /etc/hosts for mattserver. Still no ghosting:matt@bird:~ $ ls -l /cifstotal 0When I try accessing the server directory again, I no longer get a list of shares:matt@bird:~ $ ls -l /cifs/mattserverls: cannot access /cifs/mattserver: No such file or directoryBut when I access an actual share, I get full access:matt@bird:~ $ ls -l /cifs/mattserver/web[correct listing of files -- removed]I should be able to rely on broadcasting and I shouldn't need to have anything in /etc/hosts (right?). Broadcasting is working:matt@bird:~ $ nmblookup mattserverquerying mattserver on 192.168.0.255192.168.0.2 mattserver<00>ProblemsWhen I try and access a list of servers by calling ls -l /cifs, I get nothing.When I try and access a list of shares by calling ls -l /cifs/mattserver, I get a screwed up list (see above).I can't get a share mounted without adding an entry for the servername to /etc/hosts. I don't want to rely on a kludgy entry in /etc/hosts.What are my options here?
Automounting not working correctly for CIFS shares; weird results
linux;samba;automounting;autofs