Backing up DietPi to NAS drive

I have a few machines running DietPi, one of which has an external drive attached. While that machine has no problem backing up to the attached drive, I’ve realised that dietpi-backup does not work over samba.

Can anyone tell me the easiest way to backup all DietPi machines to the same ext4 NAS drive? I assume one of the cloud/backup packages but could anyone recommend one? I’m not looking for anything fancy, just a lightweight package that can perform a regular scheduled backups from multiple servers.

Many thanks,
Jim

Jimbroze
Mount the samba share as drive to e.g. /mnt/samba. You can do that e.g. via dietpi-drive_manager > network drives.

Then start dietpi-backup and select /mnt/samba or some sub directory as target. That should work. Since rsync has some internal mechanism to sync to network resources directly, we plan to implement this to dietpi-backup in the future, so it would then be not required to mount the share.

Thanks MichaIng.
I tried that but it produces an error as the file system is listed as CIFS through the Samba share rather than EXT4. Could this be due to Samba settings?

Jimbroze
Ah sorry, forgot that of course dietpi-backup checks if the target file system supports UNIX permissions. Without backing up permissions, recovering the backup would lead to a broken system.

CIFS does not support permissions, that’s indeed the problem. AFAIK with NFS it would be possible as long as the NFS server file system, where the share points to, supports UNIX permissions as well: ext4, F2FS, BTRFS and such.

MichaIng
After a bit of a hiatus I’m trying to achieve this again. NFS (using the dietpi-software NFS client and drive_manager) doesn’t seem to work as it mounts the filesystem as “Web”. Does it need to be mounted a different way?

I am doing the same among my dietpi devices.
Install NFS server and edit /etc/exports

/mnt/backup/odroid 192.168.1.123(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check)

Then on the client just mount from drive_manager with nfs client and use the path as a backup point.

Thanks for this solution, but i can-t access to my NAS without a username/Password.
Can you please tell me where should i insert them?

Hi,

Does you NAS provides a NFS share? If yes, it could be mounted using DietPi drive manager.

Hi, thanks for the reply.
I really don-t have a clue!
It is a Qnap, and i have to investigate!

That is what this solution is about. To have a NFS share mounted

Already created on My Qnap NAS, gave all the permissions, but…tried everything bu i simply can-t Access/Mount it on Drive Manager!
So annoying…
Any other ideas, please?

on your Qnap NA, do you create a CIFS share or a NFS share? What option you use on dietpi-drive_manager to mount the network share?

On Qnap i have created a NFS share folder, named it “DietPi” and like i told you before, gave all the permissions.
On drive manager i chose “Add network drive” and then “NFS”.
Next gave the ip address/share folder.

Any thoughts what can be wrong?

Btw, no matter what, i thank you very much🙏

can you try to mount the NFS export manually

mount <nfs_server_ip>:/server/export /mnt/nfs_client

I guess no…
Watch the print screen

well your mount command seems to be wrong. Looks like you are trying to have /mnt/Backup as target directory. But it is not existing. Pls ensure to have the directory created before.

As well server/export was just an example for an exported NFS directory. It would need to be replaced by your own folder you have exported on your NAS.

Ok, sorry but i can’t follow your thoughts!

I have a NFS folder created on My NAS and named it “DietPi”. My NAS ip is 192.168.31.8.
Here, on dietpi machine i wat to name the NFS mounted as “Backup”, so what am i supposed to do?

I tried this:
mount 192.168.31.8/DietPi /mnt/Backup

But didn’t work again!

first you would need to create the Backup directory on DietPi (oif not already done)

mkdir /mnt/Backup

and the mount should looks like this

mount 192.168.31.8:/DietPi /mnt/Backup

Joulinar, i really don’t know how can i thank you enough!
It worked Man!!! Finally…Amazing!
You are the best.
Now i just need to search/learn how to schedule automatic backups to the NAS.
Thanks a lot, seriously. :wink:

Update:
Didn’t work:
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/lib/zlib_deflate” failed: Operation not permitted (1)
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/lib/zstd” failed: Operation not permitted (1)
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/mm” failed: Operation not permitted (1)
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/net” failed: Operation not permitted (1)
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/net/6lowpan” failed: Operation not permitted (1)
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/net/802” failed: Operation not permitted (1)
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/net/8021q” failed: Operation not permitted (1)
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/net/9p” failed: Operation not permitted (1)
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/net/appletalk” failed: Operation not permitted (1)
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/net/atm” failed: Operation not permitted (1)
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/net/ax25” failed: Operation not permitted (1)
rsync: chown “/mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/net/batman-adv” failed: Operation not permitted (1)

It is very strange because it copied all the tree, created all the directories, but somehow there were files that gave these errors…

hmm looks like permission issues. You would need to compare source and target file system

ls -la /lib/modules/5.4.79+/kernel/
ls -la /mnt/Backup/dietpi-backup/data/lib/modules/5.4.79+/kernel/

Which user you used to run dietpi-backup ?