Using a NFS share for /data directory
These are the steps to move an existing NAbox 4 instance data directory to a NFS share.
Words of caution
Moving /data directory to a NFS share hasn't been extensively tested
and is known to disrupt some NAbox features, like network configuration
through web ui, and applying NAbox upgrade.
Use at your own risk and report any issue you have.
- Mount your NFS volume to
/datatmp
$ sudo mount <NFS server IP>:/path /datatmp
- Stop NAbox services
$ sudo systemctl stop nabox; sudo systemctl stop naboxd
- Copy data to the new volume
rsync -a /data /datatemp
- Modify mount path for
/data
Edit /etc/systemd/system/data.mount and change What and Type :
$ sudo vi /etc/systemd/system/data.mount
[Unit]
Before=local-fs.target
[Mount]
What=<NFS server IP>:/path
Where=/data
Type=nfs
[Install]
WantedBy=local-fs.target
- Reload system services
$ sudo systemctl daemon-reload
- Restart NAbox
$ sudo reboot