NFS server with auto mount on Raspberry

The raspberries /home/<path> directory can be mounted to other computers filesystem

sudo apt install nfs-kernel-server

/etc/exports need to hold what will be exported

/home/<path>       192.168.1.0/24(rw,no_subtree_check,async)

sudo systemctl restart nfs-kernel-server

On the client system as root (or sudo) type mount -t nfs 192.168.1.<x>:/home/<path> /<mounting point> to mount it and umount /<mounting point> to unmount it.

Autofs can be used to easily mount the filesystem at a client and without root permission. Autofs does not need to be installed on the server Raspberry, it needs to be installed just on the client.

For a Gentoo Linux client the following must be added to /etc/autofs/auto.misc

<mounting point>    -fstype=nfs,rw <Raspberry server ip>:/home/<path>

/etc/init.d/autofs restart

If the rest of the autofs configuration is done the /home/<path> directory appears on the client system under /mnt/auto/<mounting point>

Important

Since two computers are involved the user and group id numbers might not match and cause access issues.


Linurs startpage