I want to share an USB hard drive connected to a server with nfs with r/w for any client.
The server mount point (192.168.1.1:/mnt/hd5) is owned by nobody:nogroup
I have a nfs share auto-mounted in one client Opensuse 15.1 fstab
192.168.1.1:/mnt/hd5 /mnt/HD5 nfs defaults 0 0
I want when I create/copy file from the client, they get the ownership from the server mount point not the source owner.
There is a mount option grpid to do that. From mount(8) man
grpid|bsdgroups and nogrpid|sysvgroups These options define what group id a newly created file gets. When grpid is set, it takes the group id of the directory in which it is created; otherwise (the default) it takes the fsgid of the current process, unless the directory has the setgid bit set, in which case it takes the gid from the parent directory, and also gets the setgid bit set if it is a directory itself.
Unfortunately when I add this option to the mount line I get the error
sudo mount /mnt/HD5
[sudo] password for root:
mount.nfs: an incorrect mount option was specified
As an afterthought. When you are using KDE and can start Konqureror, it has a nice feature. put in the address bar:
man:/mount
and you will end up with a nicely HTML formatted version of the man page (and then you canuse the browser search function to check if the string grpid is in that page).
Same of course for all other man pages available on your system.
I looked at that page. And “grpid” is listed only as an option for “ext2” file systems. It is not mentioned for “ext3” or “ext4” or any other file system.
extX is upward compatible, any option supported by ext2 should be at least recognized by ext3 and ext4. Actually if you carefully read this page it says e.g. for ext3 “it supports the same options as ext2 as well as following additions”.
Current upstream linux explicitly lists “grpid” option for ext2, ext4 and xfs drivers.