Joined: 23 Mar 2019
|Posted: Thu May 12, 2022 7:09 pm Post subject: Preserve permissions and ownership perfectly--nfs4 share
I recently experimented a bit with diskless systems.
I managed to get iscsi boot without problems but nfsroot was very tricky.
My /etc/exports were a bit like
I configured --properly I think rpc.idmapd making it a needed service for nfs server etc.
I created a rootfs in /srv/nfs/arch.
Shared wuth nfs.
Started a vm.
Mounted the nfs share ok. (mount -t nfs4 -o rw <server>:/share /mnt)
Permissions seemed ok from a very rough "ls -l /mnt"
Some things were working ok--like creating and deleting files and dirs and using coreutils.
But I got a lot of "invalid argument" "permissions denied" and "file exists"errors.
For example i had to use a "force overwrite" clause when using package manager.
It must be some weird nfs perm/ownership issue.
I know a lot of people use nfs to share portage.
Some even use it for home dirs.
My question is how do you guys do it?
How to perfectly preserve perms and ownership via nfs?
What flags should I use for sharing and what for mounting?
The host is Gentoo.
Vm was Debian and Arch.
I am willing to give it again a try.
Thanks a lot.