Technical

Backup LXC to NAS NFS Share Fails: Fix Root Squash and NFS Version

Backup LXC to NAS NFS Share Fails: Fix Root Squash and NFS Version

Backup LXC to NAS NFS share fails with permission denied? It’s root squash. The container runs unprivileged, so root inside maps to nobody on the NFS server. Fix the export and the mount options, and the backup finishes.

Contemporary computer with black screen placed on stand near row of server steel racks in data center

Why the backup fails

Proxmox backs up LXC containers as root on the host. When the backup target is an NFS share, the host writes as root. But TrueNAS (and most NAS boxes) squash root to nobody by default. So the write gets denied. You’ll see something like rsync: mkdir "/mnt/pve/nas/dump" failed: Permission denied (13) in the task log.

It’s not a Proxmox bug. It’s the NFS export. And it’s easy to fix once you know what to look for.

Fix the TrueNAS export

On TrueNAS, edit the NFS share. Under Advanced Options, set Maproot User to root and Maproot Group to wheel. That disables root squash for this share. Save it.

If you’re not on TrueNAS, the export line in /etc/exports should look like this:

/mnt/tank/backups 192.168.1.0/24(rw,no_root_squash)

Change the network to match your LAN. The no_root_squash is the key part.

Detailed view of network cables plugged into a server rack in a data center.

Fix the Proxmox mount options

In Proxmox, go to Datacenter → Storage → your NFS storage → Edit. Set Content to VZDump backup file. Under Advanced, make sure NFS Version is 4.1 or 4.2. NFSv3 can work, but v4 handles the permissions better with unprivileged containers.

If you prefer the command line, edit /etc/pve/storage.cfg:

nfs: nas-backup
	export /mnt/tank/backups
	path /mnt/pve/nas-backup
	server 192.168.1.50
	content backup
	options vers=4.2
	maxfiles 3

Then restart the storage: pvesm set nas-backup --options vers=4.2 or just reboot the node. The backup job should pick it up.

Test it before you trust it

Run a manual backup of one LXC container. Watch the task log. If it says permission denied, double-check the export. If it says connection refused, check the NFS version and firewall. Port 2049 needs to be open between the host and the NAS.

I’ve seen people chase this for hours. It’s always the same two things: root squash on the NAS, or NFS version mismatch. Fix those and the backup just works.

If you’re also dealing with NFS storage errors when adding it in Proxmox, check error (500) adding nfs storage for the other common gotchas.

Leave a comment

Comments are reviewed before they appear. Your email is never published.