Proper Backups of PiHole & Shrink Image for Backup/Storage Purposes

OK awesome.

You may create such an image file by your favourite sd card imaging tool, e.g. using dd or Balena Etcher or Win32 Disk Imager or whatever tool you prefer.
I'd recommend to extract the image file to a hard drive.

OK so this process I have been doing so far with Win32 Disk Imager, making a 30GB image. Once I have this image I can use the Pishrink script which should shrink it down for storage purposes? Assuming I am understanding this correctly.

Also, consider running sudo apt-get autoclean and sudo apt-get clean on the sd card OS before you extract an image.
This will remove packages from your apt cache, saving some additional space later at the cost of having to download stuff again if you choose to reinstall or reconfigure a package.

This I never knew, so I will use this going forward for sure.

As for the restore, as you said you can write the Pishrink image back to the SD card with Win 32 Disk imager?
Insert the SD into the pi and boot?

I suppose the best method for me to understand the restore process will be to attempt the restore write on a separate 32GB SD card, and see if it boots

Thank you for the detailed responses, very kind of you!

1 Like