Articles & Snippets
How to Mount a QNAP NFS Share on a cPanel Server (Persistent After Reboot)
Posted by negraru on Thu, 22 Oct 2026
This guide shows how to mount a folder from a QNAP NAS on a cPanel/WHM server (AlmaLinux, CloudLinux or CentOS) from the terminal, so the mount survives restarts and can be used as a backup destination.
Example values used in this guide
| QNAP IP address | 192.168.100.100 |
|---|---|
| QNAP NFS share | /bkp |
| Folder inside the share | servers/my-cpanel-server |
| Local mount point on cPanel | /media/QNAP |
Step 1: Enable NFS on the QNAP
- Log into QTS and go to Control Panel → Network & File Services → NFS Service.
- Enable the NFS service (NFSv3 is the safest choice for older and mixed environments).
- Go to Control Panel → Privilege → Shared Folders and click Edit Shared Folder Permissions for your share.
- Select NFS host access, enable it, and add the IP of your cPanel server with:
- Permission: Read/Write
- Squash option: No root squash
- Sync: Sync
Permission denied when listing or writing files.
Step 2: Install the NFS client on the cPanel server
dnf install -y nfs-utils # use yum on CentOS 7
Step 3: Check what the QNAP exports
showmount -e 192.168.100.100
Example output:
Export list for 192.168.100.100:
/bkp (everyone)
The export path (/bkp) is the name you will use in the mount command.
Step 4: Create the subfolder on the QNAP (one time only)
If you want to mount a subfolder such as servers/my-cpanel-server instead of the whole share, create it first. Mount the full share temporarily, create the folder, then unmount:
mount -t nfs -o vers=3 192.168.100.100:/bkp /mnt
mkdir -p /mnt/servers/my-cpanel-server
umount /mnt
You can also create the folder from QNAP File Station.
Step 5: Create the local mount point and test the mount
mkdir -p /media/QNAP
mount -t nfs -o vers=3 192.168.100.100:/backups/servers/my-cpanel-server /media/QNAP
df -h /media/QNAP
ls -la /media/QNAP
If df -h shows the QNAP size (for example 8.5T) and ls lists the files, the mount works.
Step 6: Make the mount permanent in /etc/fstab
Remove any old QNAP lines, then add the new one:
sed -i '\|QNAP|d' /etc/fstab
echo "192.168.100.100:/backups/servers/my-cpanel-server /media/QNAP nfs vers=3,_netdev,nofail,x-systemd.automount,x-systemd.mount-timeout=30 0 0" >> /etc/fstab
systemctl daemon-reload
umount /media/QNAP
mount -a
ls /media/QNAP
grep QNAP /etc/fstab
sed command deletes every line containing "QNAP" in fstab. Run grep QNAP /etc/fstab first if you have other unrelated entries.
What the mount options do
| Option | Purpose |
|---|---|
vers=3 | Forces NFS version 3, which works reliably with QNAP. |
_netdev | Waits for the network to be up before mounting. |
nofail | The server still boots if the QNAP is offline. |
x-systemd.automount | Mounts the share on first access, avoiding boot-order problems. |
x-systemd.mount-timeout=30 | Stops the mount attempt after 30 seconds. |
Step 7: Test writing to the share
touch /media/QNAP/test.txt && rm -f /media/QNAP/test.txt && echo "write OK"
Use rm -f, because on AlmaLinux and CentOS root's rm is aliased to rm -i and will ask for confirmation. If you see Permission denied, go back to Step 1 and check the NFS host access settings.
Step 8: Reboot test
reboot
After the server comes back, run:
ls /media/QNAP && df -h /media/QNAP
If you see your files and the QNAP size, the mount is permanent.
Optional: protect against backups filling the local disk
If the QNAP is offline at boot, nofail lets the server start without the mount, and cPanel backups could write to the local disk under /media/QNAP. To prevent this, make the empty mount point immutable while it is unmounted:
umount /media/QNAP
chattr +i /media/QNAP
mount -a
To undo it, unmount the share and run chattr -i /media/QNAP.
Use it for cPanel backups
In WHM, go to Backup → Backup Configuration and set the backup directory (or add an Additional Destination) to /media/QNAP. Make sure the share is mounted before backups run.
Troubleshooting
Something is using the mount, often your own shell. Leave the folder and retry:
cd /
umount /media/QNAP
fuser -vm /media/QNAP # shows what is still using it
umount -l /media/QNAP # lazy unmount, last resort
Some QNAP setups only allow the exact export path. Mount the full share elsewhere and use a bind mount:
mkdir -p /mnt/qnap-bkp
mount -t nfs -o vers=3 192.168.100.100:/bkp /mnt/qnap-bkp
mount --bind /mnt/qnap-backups/servers/my-cpanel-server /media/QNAP
With x-systemd.automount the share mounts on first access. Run ls /media/QNAP and check again. For errors, use:
dmesg | tail
journalctl -xe
Quick summary
dnf install -y nfs-utils
mkdir -p /media/QNAP
echo "192.168.100.100:/backups/servers/my-cpanel-server /media/QNAP nfs vers=3,_netdev,nofail,x-systemd.automount,x-systemd.mount-timeout=30 0 0" >> /etc/fstab
systemctl daemon-reload
mount -a
df -h /media/QNAP
Designer Edmonton