Link to home
Start Free TrialLog in
Avatar of gerhardub
gerhardub

asked on

AutoFS fails with Warning and will not map an NFS share on RedHat Enterpise Linux 4 U4

When I attempt to restart AutoFS I get the following error:

[root@tuw5 etc]# service autofs restart
Stopping automount:                                        [  OK  ]
Starting automount:
failed to load map: "/usr/sbin/automount --timeout=600 /home file /etc/auto.home soft,intr,rsize=8192,wsize=8192,nosuid,tcp"                                      [WARNING]
[root@tuw5 etc]#

The exact same configuration on my test systems works flawlessly.  What's causing this issue?
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

please post the error messages in /var/log/messages when you do "service autofs restart" as well as
grep -v ^# /etc/auto.master
grep -v ^# /etc/auto.home
grep -v ^# /etc/sysconfig/autofs
Avatar of gerhardub
gerhardub

ASKER

The results are:

Mar 22 20:54:36 tuw5 sshd(pam_unix)[13942]: session opened for user root by root(uid=0)
Mar 22 20:54:47 tuw5 autofs: automount shutdown succeeded
Mar 22 20:54:47 tuw5 automount[14464]: mount_autofs: already mounted
Mar 22 20:54:47 tuw5 automount[14464]: /home: mount failed!
Mar 22 20:54:47 tuw5 autofs: automount startup succeeded
Mar 22 20:55:31 tuw5 autofs: automount shutdown succeeded
Mar 22 20:55:31 tuw5 automount[14966]: mount_autofs: already mounted
Mar 22 20:55:31 tuw5 automount[14966]: /home: mount failed!
Mar 22 20:55:31 tuw5 autofs: automount startup succeeded

[root@tuw5 sysconfig]# grep -v ^# /etc/auto.master
/misc   /etc/auto.misc
/net    /etc/auto.net
/home   /etc/auto.home

[root@tuw5 sysconfig]# grep -v ^# /etc/auto.home
*       lfs1:/home/&

[root@tuw5 sysconfig]# grep -v ^# /etc/sysconfig/autofs
LOCALOPTIONS="soft,intr,rsize=8192,wsize=8192,nosuid,tcp"
DAEMONOPTIONS="--timeout=600"
LDAPAUTOMASTER=""
UNDERSCORETODOT=1
DISABLE_DIRECT=1
ONE_AUTO_MASTER=0
GHOSTDIRS=""
BASEDN=


I'm a little confused as to what is already mounted... there is a /home directory... but it's empty.
ASKER CERTIFIED SOLUTION
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
[root@tuw5 ~]# mount
/dev/md0 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
/dev/md1 on /home type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
lfs1:/home on /home type nfs (rw,addr=192.168.14.48)
automount(pid14833) on /misc type autofs (rw,fd=5,pgrp=14833,minproto=2,maxproto=4)
automount(pid14897) on /net type autofs (rw,fd=5,pgrp=14897,minproto=2,maxproto=4)

[root@tuw5 /]# ls -al /home
total 16
drwxr-xr-x   2 root root 4096 Mar 21 11:33 .
drwxr-xr-x  27 root root 4096 Mar 22 20:55 ..
[root@tuw5 /]# ls -al /home/swertheim
ls: /home/swertheim: No such file or directory
[root@tuw5 /]#

(There are no user directories locally...)

...and for giggles, I umount /home and restarted the autofs service... It gave me an error:

[root@tuw5 ~]# umount /home
[root@tuw5 ~]# ls
anaconda-ks.cfg  Desktop  install.log  install.log.syslog
[root@tuw5 ~]# service autofs start
Starting automount:
failed to load map: "/usr/sbin/automount --timeout=600 /misc file /etc/auto.misc soft,intr,rsize=8192,wsize=8192,nosuid,tcp"
failed to load map: "/usr/sbin/automount --timeout=600 /net program /etc/auto.net soft,intr,rsize=8192,wsize=8192,nosuid,tcp"
failed to load map: "/usr/sbin/automount --timeout=600 /home file /etc/auto.home soft,intr,rsize=8192,wsize=8192,nosuid,tcp"  

I wasn't getting that before... humph.
Oh, I figured out that I made a mistake with that last attempt and did not issue a:

service autofs restart, but a service autofs start... and that's why there was an error in the end of the last message.... just ignore that please.
Wesley,

I think I've figured this out, but I need a little help to ensure that I'm doing things right and proper:

I'm using software mirroring (RAID 1) in Linux.

What I've been able to determine is that if I issue the command:

umount -l /home

/home mount is forced to dismount...

If I then run: service autofs restart, everything works fine.

The RAID 1 is the only thing that is different between the systems!

So I edited the /etc/fstab file and put a # in front of the /home line so that /home would not mount on start up.

Is this the best way to handle the issue?  ...or should I be doing something different??

Thanks,

Gerhard
Is /home a separate filesystem on another box, or is it as part of the / filesystem?
Ok,

The way I set up the boxes are:

A file server with a /home partition called lfs1

A group of RedHat systems with individual partitions for everything.

/, /home, swap, etc... all paritioned out manually.

However, I RAID 1ed everything except the /boot parition on the RedHat workstations.

When you look into FSTAB on the RedHat Workstations, you see a /home mount that is like MD1 with ext3 1 2 or something.

What appears to work is that if I put a # in front of the /home mount on the workstations, then /home never mounts to the local local file system... and everything appears to work fine.

Is this a good idea?  Is it going to cause me issue with the NFS export from the file server of /home?  (I'm auto mounting the /home on the NFS server to the local /home for the user's home directories...)

Gerhard
I think I might miss something here because the problem seems a bit too obvious to me: you cannot automount /home because it is already mounted locally via /etc/fstab at boot time. It works when you comment out the entry in /etc/fstab because the filesystem is no longer mounted on the /home mountpoint at boot; therefore, an NFS share can be mounted there.

You should partition the workstations so that the /home directory is not a separate filesystem. Instead, make it part of the root (/) filesystem. But if you cannot easily reinstall the workstations, I guess commenting out (with #)  the entry in /etc/fstab would do it.
Are there any downsides to commenting out the /home mount?

...and no, reinstalling the workstations is not entirely possible.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial