Purpose: Create a flashable image of a drive and resize it so unused space is minimized. Created image can be flashed as a backup that contains all config files.
Application: Backups of router and pihole.
Before starting, make sure the disk to be imaged is unmounted.
- Image the source drive:
sudo dd if=/dev/sdb of=image.img bs=4M status=progressIf space is an issue,ddcan be piped straight to gzip, but you'll need to unzip before you can manipulate the image.sudo dd if=/dev/sdb bs=4M status=progress | gzip -9 > image.img.gz