Table of Contents

, , , ,

Openmediavault NAS share setup

First install dependencies:

sudo apt-get install rpcbind nfs-common

In Storage create a new share then enable NAS in OMV in Services > NFS > Settings:

NFS user permissions are based on user ID (UID). UIDs of any users on the client must match those on the server in order for the users to have access.

For example, let's say on your client Ubuntu machine you have a user 'homer' and this user has UID and GID 1000 (checked via id command). This means if there is a user on a NAS server with 1000 UID and GID (e.g. 'pi' user, but name doesn't matter) and this user has access to the nas share so will the 'homer' user from the client have access.

In the screenshot below you can see that the pi user has UID and GID 1000 and has read/write permissions. So any client connecting to this NAS server with the same UIDs or GIDs will have RW access. In this case this is mainly because the pi user belongs to the 100(users) group e.g.

root@rpi5:~# id pi
uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),102(input),105(render),107(_ssh),110(netdev),995(spi),994(i2c),993(gpio)

and this group is set to have read/write/execute permission as seen in the screenshot.

Under Services > NFS > Shares set the options:

no_subtree_check, rw, secure, sync

An easy solution to not have to match UID from the client on the server is to allow any user from the clients to access the NAS share.

To do this, modify the above to this

secure,no_subtree_check,sync,all_squash,anonuid=0

To find the UID for the anonuid, check the owner of the directory being shared and run id command for the user (usually its root user) then use that UID.

In Clients, whitelist the IPs from which you will access the share.

You can check the exports on the server:

# This file is auto-generated by openmediavault (https://www.openmediavault.org)
# WARNING: Do not edit this file, your changes will get lost.

# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
/export/bigassnas 192.168.99.0/24(fsid=324dbffb-0246-4860-8ce2-d5bc464182b1,rw,secure,no_subtree_check,sync)
/export 192.168.99.0/24(ro,fsid=0,root_squash,subtree_check)

Mount the share

To mount in on client machine use something like:

sudo mkdir -p /mnt/nas
sudo mount 192.168.99.135:/export/bigassnas /mnt/nas

Unmount:

sudo umount /mnt/nas

Gnome Files aka Nautilus can't mount it because of this bug

Tested on

See also

References