NFS mount mounted inside another NFS mount disappears randomly
I have quite an odd issue where my nested NFS mounts just disappear randomly from time to time.
The fstab entries look somewhat like this:
nfs:/home /home nfs rw,hard,intr,rsize=32768,noatime,nocto,proto=tcp 0 0
nfs:/bigdir /home/bigdir nfs rw,hard,intr,rsize=32768,noatime,nocto,proto=tcp,bg 0 0
The issue is that from time to time the "/home/bigdir" folder will be empty, even though mtab think that the share is still mounted. nfsstat et. al. do also think the share is still mounted.
Only thing that works is by unmounting, and then (re)mounting the bigdir share.
The server side is a NetApp. The client side is RHEL5.5, 2.6.18-194 kernel (Yes, I know 5.8 is out, but as far as I can see there are no erratas for this particular issue).
I can use various hacks like automount, or mounting it to another path and then using --mount bind, but I would like to fix the underlying issue.
Solution 1:
You mentioned trying automount. Did you take the /home/bigdir
entry out of autofs? I'm wondering if you left it in there by accident and automount is timing it out. I'm not sure how an entry in both fstab and autofs would play out (though I'd guess fstab would win and it would be treated as a static mount).
Also, does df -h
show /home/bigdir
as mounted as well?
Solution 2:
It seems you wouldn't have to mount bigdir from the NFS share also. as you are already mounting home with bigdir nested in it. So then you should just have to
mount /home/bigdir /bigdir
Or even possibly just make a soft link?
Solution 3:
I think the "underlying issue" cannot be corrected. When your /home remounts, for exmple due to connection problems, your nested mount becomes hidden, because the directory where it was mounted to is not exist (). I tink the best solution is to mount the nested share to another point, and use a symlink. This is the way I always do. Btw. crossmnt and nohide would be the best to include on server's exports and mount one share.