Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Server CentOS 6.5 and Selinux is permissive

My NFS server share in /etc/exports

/home/unixmen/  10.0.0.0/24 (rw,sync,no_root_squash)

Client running on another CentOS 6.5 host , is able to mount normally..

When I try automount with autofs, nothing works, did lot to google search of this issue to figure out the root cause, yet unsuccessful.

I am wondering if I am doing something basic error..

Please see the autofs configs

~]$ cat /etc/auto.master
#/net -hosts
#+auto.master
/misc /etc/auto.misc

and

~]$ cat /etc/auto.misc
unixmen -fstype=nfs 10.0.0.14:/home/unixmen

I did change the log level to debug in /etc/sysconfig/autofs, post restarting the autofs and log says

Jun 27 17:20:00 ganeshh automount[12322]: mounted indirect on /misc with timeout 300, freq 75 seconds

Not sure if this is related to mount issue

Recently now, I get this data in the log

Jun 27 18:11:49 ganeshh automount[12322]: expire_proc: exp_proc = 3063937904 path /misc
Jun 27 18:11:49 ganeshh automount[12322]: expire_cleanup: got thid 3063937904 path /misc stat 0
Jun 27 18:11:49 ganeshh automount[12322]: expire_cleanup: sigchld: exp 3063937904 finished, switching from 2 to 1
Jun 27 18:11:49 ganeshh automount[12322]: st_ready: st_ready(): state = 2 path /misc

eventually there is not mounted files in /misc directory

share|improve this question
    
You've assured us that client can mount 10.0.0.14:/home/unixmen manually, yes? You can confirm that ls -al /misc/unixmen returns a file-not-found error, yes? My next point is I've never seen -fstype=nfs in an automount table before; my belief is that's implied and may not be valid to state. Could you try removing that, restarting automount and then doing ls -la /misc/unixmen? –  MadHatter Jun 27 at 6:59
    
Yes I deleted -fstype=ns from the entry , now its like this in the file cat /etc/auto.misc unixmen 10.0.0.14:/home/unixmen restarted autofs , but the change is pretty the same, unable to view the mounted partition . ls -l /misc returns 0 –  user173639 Jun 27 at 7:04
    
And what did you get when, after restarting automount, you did the ls? Also, can you confirm the two previous points in my comment? –  MadHatter Jun 27 at 7:04
    
I didn't ask for ls -l, I asked for ls -al, and (sorry to ask) can you confirm that you're doing it on /misc/unixmen, not just /misc? Your question makes that unclear. I presume that showed only . and .., but it would be useful to have it confirmed - and better still to see it (cut-and-paste both command and output into your answer). Still seeking confirmation on my first two points as well. –  MadHatter Jun 27 at 7:07
1  
I do not see unixmen directory at all, tried many times ls -al /misc/ total 4 drwxr-xr-x. 2 root root 0 Jun 27 18:33 . dr-xr-xr-x. 25 root root 4096 Jun 27 00:31 .. [root@ganeshh ~]# ls -al /misc/ total 4 drwxr-xr-x. 2 root root 0 Jun 27 18:33 . dr-xr-xr-x. 25 root root 4096 Jun 27 00:31 .. –  user173639 Jun 27 at 7:16

1 Answer 1

Now we've got it working (-fstype=nfs is not needed, and probably not valid, in a map) your question betrays a misunderstanding about how automount presents to the user.

Here's an automount entry in my master file

/mnt    /etc/auto.master.d/mnt

and the corresponding map

# cat /etc/auto.master.d/mnt
helvellyn       -ro,soft,intr   10.18.145.31:/var/log/httpd
bowfell         -ro,soft,intr   10.18.145.27:/var/log/httpd

Now here's some ls output on the trigger directory

# ls -al /mnt
total 4
drwxr-xr-x  2 root root    0 Jun 14 10:01 .
dr-xr-xr-x 25 root root 4096 Jun 27 03:37 ..

Note that a) the directory is empty, and that b) the size is 0 bytes. The former confused you, and the latter is unlawful: even an empty directory has size 4096 bytes. But the zero is a shorthand way of knowing that automount has correctly read your maps, and is possessing the directory. You can also check with df:

# df -k /mnt
Filesystem             1K-blocks  Used Available Use% Mounted on
/etc/auto.master.d/mnt         0     0         0    - /mnt

Now let's list the target directory, even though the parent is apparently empty:

# ls -al /mnt/helvellyn
total 761548
drwxr-xr-x 2 root root      4096 Jun 23 13:21 .
drwxr-xr-x 3 root root         0 Jun 27 07:31 ..
-rw-r--r-- 1 root root         0 Jun  1 03:18 access_log
-rw-r--r-- 1 root root   7485078 May 11 03:09 access_log-20140511
-rw-r--r-- 1 root root   7052254 May 18 03:06 access_log-20140518
-rw-r--r-- 1 root root   5357900 May 25 03:28 access_log-20140525
-rw-r--r-- 1 root root    577579 May 25 16:36 access_log-20140601
[...]

Content magically appears! Now let's list the parent again:

# ls -al /mnt
total 8
drwxr-xr-x  3 root root    0 Jun 27 07:31 .
dr-xr-xr-x 25 root root 4096 Jun 27 03:37 ..
drwxr-xr-x  2 root root 4096 Jun 23 13:21 helvellyn

Automount really does do demand-driven mounting (and unmounting). Since /mnt/helvellyn won't be mounted until you try to access it, you cannot see it until the first access triggers the mount.

I hope you will forgive me for adding that if you take one other lesson from this answer, it should be that detail is vitally important in UNIX sysadmin. If an instruction asks you to do do X, it may well be important to do exactly X, and not something that you think is entirely equivalent to X. That little zero-size directory should give you some indication of how little information is sometimes presented to you to know that certain things, particular older UNIX-things, are working correctly. If, through imprecision, you skate past those tiny signs, UNIX won't give you anything else to go on, and confusion may result.

share|improve this answer
    
Lakeland Fells - cool naming convention. –  Iain Jun 27 at 7:49
    
<grin> why, thank you! At this site, we started from the top down (scafell - one-word peaks only) and are working down towards 1000'. See also serverfault.com/questions/479945/… . –  MadHatter Jun 27 at 8:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.