?
Solved

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

Posted on 2007-03-22
11
Medium Priority
?
3,399 Views
Last Modified: 2013-12-16
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?
0
Comment
Question by:gerhardub
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
11 Comments
 
LVL 38

Expert Comment

by:wesly_chen
ID: 18775987
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
0
 
LVL 1

Author Comment

by:gerhardub
ID: 18776613
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.
0
 
LVL 38

Accepted Solution

by:
wesly_chen earned 1000 total points
ID: 18776748
Please also post the output of
# mount

# ls -al /home/<username>
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 1

Author Comment

by:gerhardub
ID: 18778407
[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.
0
 
LVL 1

Author Comment

by:gerhardub
ID: 18781539
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.
0
 
LVL 1

Author Comment

by:gerhardub
ID: 18789937
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
0
 
LVL 4

Expert Comment

by:infleadorix
ID: 18790171
Is /home a separate filesystem on another box, or is it as part of the / filesystem?
0
 
LVL 1

Author Comment

by:gerhardub
ID: 18790580
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
0
 
LVL 4

Expert Comment

by:infleadorix
ID: 18790729
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.
0
 
LVL 1

Author Comment

by:gerhardub
ID: 18791643
Are there any downsides to commenting out the /home mount?

...and no, reinstalling the workstations is not entirely possible.
0
 
LVL 4

Assisted Solution

by:infleadorix
infleadorix earned 1000 total points
ID: 18792363
I don't mean to take over wesley_chen prior work. The questions he has asked you are helpful in figuring out what might be the issue.

There is no downside to commenting out the /home mount entry from /etc/fstab besides the fact that whatever is stored locally (on the local /home filesystem) will not be accessible while the filesystem is unmounted. In other words, you have to unmount the local filesystem in order to mount the NFS share; that makes the content of your local filesystem inaccessible until it is later mounted. Thus, you can create another directory such as /home_loc and mount the local /home filesystem there. This way you have access to both the NFS-shared /home as well as local /home. Another downside is that you lose the disk space allocated to the local /home directory, which could have been allocated to other filesystems.

I assume you mount /home via NFS in conjunction with using some sort of centralized authentication (e.g. NIS, LDAP) to authenticate the users site-wide? In that case, I don't think you have anything stored in the local /home directory on each workstation. Thus, just commenting it out should not cause any problem.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question