Help reverting dietpi-backup back to full backups from incremental

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version | G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=19
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
  • Distro version | bullseye 0
  • Kernel version | Linux RuuviPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
  • Architecture | arm64
  • SBC model | RPi 4 Model B (aarch64)
  • Power supply used | Geekworm X708 UPS HAT, USB-C 5V 4A Adapter
  • SD card used | SanDisk 128GB MAX Endurance

Additional Information (if applicable)

  • Software title | dietpi-backup
  • Was the software title installed freshly or updated/migrated?
  • Can this issue be replicated on a fresh installation of DietPi?
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

  1. run dietpi-backup
  2. backup to 500GB USB attached m.2 drive managed by dietpi-drive_manager formatted in ext4

Expected behaviour

  • each data_* folder in dietpi-backup should contain a full backup around ~33GB each
  • 10-12 backups should fill the drive and then rollover after each backup
  • each data_* folder size reported correctly around ~33GB

Actual behaviour

  • dietpi-backup does not create a full backup.
  • Each folder appears to be an incremental backup?
  • however the total size of dietpi-backup folder is reported around ~1.24TB… uhhh what?!?

Extra details

  • df -h:
    Filesystem Size Used Avail Use% Mounted on
    /dev/root 118G 30G 83G 27% /
    devtmpfs 3.9G 0 3.9G 0% /dev
    tmpfs 3.9G 0 3.9G 0% /dev/shm
    tmpfs 1.6G 162M 1.4G 11% /run
    tmpfs 5.0M 0 5.0M 0% /run/lock
    tmpfs 3.9G 32K 3.9G 1% /tmp
    tmpfs 50M 20K 50M 1% /var/log
    /dev/mmcblk0p1 127M 32M 95M 26% /boot
    /dev/sda1 458G 38G 420G 9% /mnt/51a06b5d-f9f5-484c-a05c-dcc81a50e522
    tmpfs 787M 4.0K 787M 1% /run/user/0

smartctl reports drive as OK.

Everything was fine until a recent update, sometime in the past 6 months, no idea what update caused the backup behavior to change. How do I revert to non-incremental backups?

Screenshot 2025-12-03 180700

It came with v9.17

DietPi-Tools | DietPi-Backup If multiple backups are created (and kept), the rsync --link-dest option is now used to create files which did not change between last and current backup iteration as hard links to the last iteration. This usually leads to massively reduced effective disk usage and backup speedups, since unchanged files do not need to be copied, while every backup iteration however remains fully self-contained. Many thanks to @nicojx for making us aware of rsnapshot, which uses the same technique: MichaIng/DietPi?7711

There is no way back, why would you wanna go back?
I guess Windows does not handle ext4 with hard links well. 33GB * 39 is roughly 1.2 TB, but in fact, you have only stored files “worth” of 39GB. You can now save a lot more backups, I don’t get why you want the old behavior back :sweat_smile:

Thanks for your answer, I will have to adjust my backup strategy then. My main concern with incremental backups is: If the drive develops bad sectors where the first backup data is stored all subsequent backups are rendered useless. That seems unlikely though since SSDs tend to just die outright.

Is it possible for dietpi-backup to have multiple locations?

If your SSD just dies all backups are gone :sweat_smile:

No.

A different locations can be set insider dietpi-backup manually

I just checked the script, you can even call it with a custom path each time

$2 = optional directory location to use with backup/restore input:
	# - dietpi-backup -1 /path/to/target = Restore
	# - dietpi-backup  1 /path/to/target = Backup

If you are using the daily backup feature, you would need to deactivate it and and create a custom script which execute it daily (or howoften you want) with cron or systemd timers.

You could also try to duplicate the backup script and just remove this line, which creates the hard linkes, so you would get full backups again. (I did not test this, so I don’t know if this has other side effects. Pls test this before using it on working systems)
(see also: https://github.com/MichaIng/DietPi/discussions/7711#discussioncomment-14341469)

On the logical layer they are full backups each, but on the physical layer incremental via hardlinks. The concern that one corrupted sector/inode hence can render related files in all backups broken is valid :thinking:, at least for those files which did not change.

The backup path is stored in /boot/dietpi/.dietpi-backup_settings. So one could also e.g. alternate between 2 locations with another daily cron job that just swaps the location back and forth, so if a file is corrupted in one of the series, and on the live system, there is one other copy guaranteed.

But this is an argument to give some more control of this feature, like assuring one new set of all inodes every X runs or so. But before that, I want to have dedicated weekly/monthly backups :slightly_smiling_face:.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.