[linux-cifs-client] Hardcoded cifs mount works but not automounter
(autofs)
Leif Adelöw
leif at adelow.com
Tue Aug 14 10:41:05 GMT 2007
Hi,
I have a problem with mount.cifs not beeing able to resolve NAMES (at
least I think I do). Any help is very much appreciated!
Using autofs with;
auto.master: /xcip /etc/auto.dir/auto.xcip --timeout=60
auto.xcip: Measurements -
fstype=cifs,username=yyy,password=xxx,file_mode=0644,dir_mode=0755,uid=leif,gid=users,iocharset=utf8 ://xcip/Measurements
works but not
auto.master: /cifs program:/etc/auto.dir/auto.cifs --timeout=60
auto.cifs:
--<auto.cifs>
#!/bin/bash
# $Id$
# This file must be executable to work! chmod 755!
key="$1"
mountopts="-fstype=cifs,file_mode=0644,dir_mode=0755,uid=user,gid=users"
smbclientopts=""
for P in /bin /sbin /usr/bin /usr/sbin /usr/local/samba/bin/
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
fi
done
[ -x $SMBCLIENT ] || exit 1
mountopts=$mountopts",username=yyy,password=xxx"
smbclientopts="-Uyyy%xxx"
$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 }
'
--</auto.cifs>
$/etc/auto.dir/auto.cifs xcip
gives:
----------------------------------------------------
-
fstype=cifs,file_mode=0644,dir_mode=0755,uid=user,gid=users,username=yyy,password=xxx\
/D$ ://xcip/D$ \
/mxccomtest ://xcip/mxccomtest \
/NUUS2002\ (E) ://xcip/NUUS2002\ (E) \
/temp ://xcip/temp \
/ADMIN$ ://xcip/ADMIN$ \
/Source ://xcip/Source \
/C$ ://xcip/C$ \
/Measurements ://xcip/Measurements
-------------------------------------------------------
$ls /cifs/xcip
reveals (log-file):
---------------------------------------------------
Aug 14 11:25:39 pole automount[2906]: mount(generic): failed to
mount ://xcip/D (type cifs) on /cifs/xcip/D
Aug 14 11:25:40 pole automount[2906]: >> mount error: could not find
target server. TCP name ///xcip/mxccomtest not found No ip
address specified and hostname not found
---------------------------------------------------------
I've also tried to add the hostname option to automount/mount.cifs
I'm using:
Linux automount version 4.1.3-28
mount.cifs version: 1.6 (samba-client-3.0.14a-2.1.fc3.kde)
Apologize for a rather lengthy post!!
Best Regards
Leif Adelöw
More information about the linux-cifs-client
mailing list