Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
buster 0
Kernel version | uname -a
Linux avberry 5.10.103-v8+ #1529 SMP PREEMPT Tue Mar 8 12:26:46 GMT 2022 aarch64 GNU/Linux
SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
RPi 4 Model B (aarch64)
Power supply used | (EG: 5V 1A RAVpower)
OKDO Raspberry Pi 4 Power Supply
SD card used | (EG: SanDisk ultra)
SanDisk 32 GB
Additional Information (if applicable)
Steps to reproduce
Create NFS mount on Netgear ReadyNAS Duo
Create dietpi-backup config using the NFS mount
Attempt to create back-up
Expected behaviour
Back-up completes
Actual behaviour
Back-up hangs forever.
Extra details
I want to use dietpi-backup to create a backup and then I’ll take that back-up and copy it to the cloud using rclone and b2.
My RPi4 does not have enough space (12GB left) for a back-up (rsync dry-run says 15GB needed). So I tried to back-up to a mounted NAS (Netgear ReadyNAS Duo), but dietpi-backup mandates NFS be used. I created a new NFS mount, which is recognised, but backup never completes.
There are some rsync errors, which it seems to get past and begins copying files before hanging.
rsync: chown [some file] failed: Operation not permitted (1)
I’ve tried to troubleshoot this, but with no success. Previously when using rsync no with dietpi these errors were ignored and the files all copied successfully.
Digging deeper I think there is a sync problem with NFS, but I don’t understand that.
dmesg gives me this
[12568.797732] NFS: Server 192.168.1.2 reports our clientid is in use
[12568.797766] NFS: state manager: lease expired failed on NFSv4 server 192.168.1.2 with error 1
Did you checked logs from NFS server side? Are there any? If found a couple if similar messages on the web. Most of them are talking about lost connections or NFS server reboots.
I’m not sure I can get access to the logs. There was a time I had SSH access to the NAS, but they close that loophole to get access and now I think I’m left with the Web UI.
Let me see if that offers logs and/or if there is a network share with logs available.
I can copy files and access files on the NFS mount to the NAS fine although I’ve not tried to copy a huge file to stress test it.
There are some rsync errors, which it seems to get past and begins copying files before hanging.
rsync: chown [some file] failed: Operation not permitted (1)
I’ve tried to troubleshoot this, but with no success. Previously when using rsync (not with dietpi) these errors were ignored and the files all copied successfully.
When running dietpi-backup the rsync commands copy files across correctly and I can see them directly on the NAS, but then it hangs.
not sure if this will be helpful. Because you still need to have the possibility to change owner. rsync will need to copy all files with current permission and owner, as they are exist on the original source system.
Does rsync copy first and then change owner or can it do it in one?
I wonder if not all users and groups with the same uid and gid exist on my NAS and if they did exist chown might not be needed. I can update the NAS with these if needed.
You can tell my knowledge or rsync and NFS is minimal.
I am using /mnt/raid *(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check)
I did not investigate further, whether a (rw,async,root_squash,crossmnt,no_subtree_check) would be better.
As far as I understand, your NFS setup is done via a GUI without editing the /etc/exports file directly.
Maybe on your GUI you can select some of the options.
@StephanStS I have now gained access to the /etc/exports file and made the change suggested above by @Joulinar (not success). You use no_root_squash and if I’m understanding correctly it’s root_squash that’s causing my issue, so I will try with no_root_squash this time and perhaps later no_all_squash if that’s valid on my NFS instance.
If you investigate on this issue a bit more to find a better solution without no_root_squash would be appreciated. As far as I know, no_root_squash is a bit more unsecure. The result could be a point which we could add to a documentation section “hardening NFS” (which we actually do not have, but I’d like to have it).