Hello!
I’m running into problems using NFS/NIS and automount for homes.
My config files are (nearly) identical on every client:
/etc/fstab:
/dev/disk/by-id/ata-ST1000VX000-1CU162_Z1DCQMPZ-part3 swap swap defaults 0 0
/dev/disk/by-id/ata-ST1000VX000-1CU162_Z1DCQMPZ-part1 swap swap defaults 0 0
/dev/disk/by-id/ata-ST1000VX000-1CU162_Z1DCQMPZ-part2 / ext4 acl,user_xattr 1 1
/localhome /nfs4/localhome none defaults,bind 0 0
/etc/exports:
/nfs4 *(fsid=0,crossmnt,rw,no_root_squash,async,no_subtree_check,insecure)
/nfs4/localhome *(rw,no_root_squash,async,no_subtree_check,insecure)
/nfs4/localhome/[local client name] *(rw,no_root_squash,async,no_subtree_check,insecure)
/etc/auto.master:
+auto.master
/home auto.home rsize=8192,wsize=8192
/etc/auto.home:
* -fstype=nfs4,rw,intr,hard,timeo=300 &:/localhome/&
Up to now users had their home defined in /etc/passwd just as /home/[local client]/[userid]
and everything worked fine: users could login on any client in the subnet and found their home mounted.
But now I had to upgrade one client with a bunch of harddisks, mounted in subdirs of /localhome.
The config files for the client with newly mounted disks in subdirs:
/etc/fstab:
/dev/disk/by-id/ata-INTEL_SSDSC2BW240H6_CVTR551303N8240CGN-part1 swap swap defaults 0 0
/dev/disk/by-id/ata-INTEL_SSDSC2BW240H6_CVTR551303N8240CGN-part3 swap swap defaults 0 0
/dev/disk/by-id/ata-INTEL_SSDSC2BW240H6_CVTR551303N8240CGN-part2 / ext4 acl,user_xattr 1 1
/dev/disk/by-id/ata-ST4000NM0033-9ZM170_Z1Z9CWSK-part1 /localhome/gauss/1 ext4 defaults 1 2
/dev/disk/by-id/ata-ST4000NM0033-9ZM170_Z1Z9D4KQ-part1 /localhome/gauss/2 ext4 defaults 1 2
/dev/disk/by-id/ata-ST4000NM0033-9ZM170_Z1Z9D7WZ-part1 /localhome/gauss/3 ext4 defaults 1 2
/localhome /nfs4/localhome none defaults,rbind 0 0
/etc/exports:
/nfs4 *(fsid=0,crossmnt,rw,no_root_squash,async,no_subtree_check,insecure)
/nfs4/localhome *(rw,no_root_squash,async,no_subtree_check,insecure)
/nfs4/localhome/gauss *(rw,no_root_squash,async,no_subtree_check,insecure)
/nfs4/localhome/gauss/1 *(rw,no_root_squash,async,no_subtree_check,insecure)
/nfs4/localhome/gauss/2 *(rw,no_root_squash,async,no_subtree_check,insecure)
/nfs4/localhome/gauss/3 *(rw,no_root_squash,async,no_subtree_check,insecure)
The new case should be /home/gauss/1/[userid] for this user.
and this is exactly what is done by autofs and NFS on remote clients.
These subdirs are exported fine so on remote clients they are visible AND filled with their content.
But on the localhost they are empty. It seems that autofs detects it as local and does a bind mount instead of a rbind mount.
Result is that the sub-folders 1 to 3 of the bind-mounted localhome/gauss/ don’t show the file system but just the empty dirname.
In consequence a local login of the user leads to the message:
> cd ~
bash: cd: /home/gauss/1/[userid]: No such file or directory
Any suggestions on how to
a) tell autofs to use rbind instead of bind or
b) any workaround for this scenario?