alamahant Advocate

Joined: 23 Mar 2019 Posts: 2481
|
Posted: Thu May 12, 2022 7:09 pm Post subject: Preserve permissions and ownership perfectly--nfs4 share |
|
|
Hi Guys
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
Code: |
/srv/nfs *(rw,fsid=0,no_all_squash,no_root_squash,subtree_check)
/srv/nfs/arch *(rw,nohide,no_all_squash,no_root_squash,subtree_check)
|
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"
Chrooted ok
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. _________________
 |
|