Can't get autofs working (CIFS)

General support questions including new installations
paulmancan
Posts: 26
Joined: 2005/07/01 15:16:51

Re: Can't get autofs working (CIFS)

Post by paulmancan » 2009/10/04 05:22:32

Commented out and still nothing :(

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can't get autofs working (CIFS)

Post by TrevorH » 2009/10/04 07:22:55

Did you try an autofs restart. It does something different to a reload and might generate an error message that's otherwise missing.

It's also possible that the error messages only occur at mount time so you need to look in /var/log/messages after the reference to /test/test/whatever (autofs won't even try to mount this until it's looked at so you need to look at something under /test/test before it will make the connection attempt).

paulmancan
Posts: 26
Joined: 2005/07/01 15:16:51

Re: Can't get autofs working (CIFS)

Post by paulmancan » 2009/10/05 21:04:52

Unless I am terribly stupid, there is simply something wrong with autofs. Perhaps someone could be kind enough to exact test?

I did a clean install of CENTOS 5.3 i386 with only BASE packages selected and followed the wiki instruction to the T:

a) My XP machine is \\10.0.1.1\Share, user = test, password = test = RW access

b) Set winbox to 10.0.1.1 in /etc/hosts

c) ping winbox = OK = winbox resolves as 10.0.1.1

d) mkdir -p /mnt/mybox

e) mount -t cifs //10.0.1.1/Share -o username=test,password=test /mnt/mybox THIS WORKS

f) mount -t cifs //winbox/Share -o username=pfine,password=elephantcast /mnt/mybox THIS DOES NOT WORK FOR SOME REASON (error) MAYBE THE SAME CAUSE HERE IS THE PROBLEM???

mount: wrong fs type, bad option, bad superblock on //winbox/Share,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so



g) mkdir -p /mymount

h) /etc/auto.master contains (everything else REM'd out,) ONLY:

/mymount /etc/auto.mymount


i) /etc/auto.mymount:

winbox -fstype=cifs,rw,noperm,user=test,pass=test ://winbox/Share


j) also tried /etc/auto.mymount:

10.0.1.1 -fstype=cifs,rw,noperm,user=test,pass=test ://10.0.1.1/Share


k) chmod 755 auto.mymount

j) service autofs restart, service autofs reload

k) cd /mymount

l) ls /mymount = NOTHING AND NOTHING in messages


Thanks

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can't get autofs working (CIFS)

Post by TrevorH » 2009/10/05 21:29:29

Here's what I did and this works for me. You need to adjust for your setup.

[root@trevor4 ~]# cat /etc/auto.master | grep -v ^#
/misc /etc/auto.misc

[root@trevor4 ~]# cat /etc/auto.misc | grep -v ^#

cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
net -fstype=cifs,rw,username=myuser,password=MyPassIsCaseSens ://WINDOWSMACHINE/C\$

[root@trevor4 ~]# service autofs reload
Reloading maps

[root@trevor4 ~]# ls -la /misc/net
total 318
drwxr-xr-x 1 root root 0 Oct 5 22:13 .
drwxr-xr-x 3 root root 0 Oct 5 22:23 ..
-rwxr-xr-x 1 root root 0 Aug 11 2004 AUTOEXEC.BAT
etc

The rule about `service autofs reload` vs restart is that a restart is required if you amend /etc/auto.master but not if you amend any of the files it refers to.

Notice that I am listing one level further down than you are - /misc is where autofs controls but /misc/net is the directory that is mentioned in /etc/auto.misc and it's only when you ls -la that subdir of /misc that the auto-mount occurs

For you, when you say

[quote]
l) ls /mymount = NOTHING AND NOTHING in messages
[/quote]
you probably want to be doing `ls -la /mymount/winbox`

User avatar
toracat
Site Admin
Posts: 7518
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: Can't get autofs working (CIFS)

Post by toracat » 2009/10/05 22:36:58

I would suggest the same thing as TrevorH. You must [b]access[/b] the share for autofs to mount anything. So, [i]ls /mymount[/i] is not enough because it is not accessing your share. ls /mymount/winbox should work.

paulmancan
Posts: 26
Joined: 2005/07/01 15:16:51

Re: Can't get autofs working (CIFS)

Post by paulmancan » 2009/10/06 21:47:15

uhhh-huhhh so I see that my chmod 755 of my auto file causes the problem. Seems it must be 644 to work!

Post Reply