Install software:
studen@labkey:~$ sudo apt-get update
[..]
W: https://pkgs.k8s.io/core:/stable:/v1.34/deb/InRelease: Policy will reject signature within a year, see --audit for details
studen@labkey:~$ sudo apt-get install nfs-kernel-server
#check if it is running
studen@labkey:~$ systemctl status nfs-kernel-server
Edit /etc/exports
:
/data1 178.172.43.129(rw,sync,no_root_squash,no_subtree_check)
/data1 127.0.0.1(rw,sync,no_root_squash,no_subtree_check)
This allows to mount it either via localhost (second line) or the valid ip of the labkey server.
Reload configuration and resetart the server:
studen@labkey:~$ sudo exportfs -ra
studen@labkey:~$ sudo systemctl restart nfs-kernel-server
Test mounting and unmounting
studen@labkey:~$ sudo mkdir /mnt/disk
studen@labkey:~$ sudo mount 127.0.0.1:/data1 /mnt/disk
studen@labkey:~$ sudo umount /mnt/disk