Backup boot SD card ( without unused space )
Backup boot SD card ( without unused space )
Hi,
I would like to backup the booted SDcard of my Raspberry pi.
I don't necessary need to backup as a hot backup[^1] So I can remove the SDcard and make the backup on another machine.
\
Thanks.
[^1]:Backup that can be taken while the system is running.
Put the sdcard in a Linux box with a GUI
Step one: shrink the image size use gparted, re-size the main partition to as small as possible
Step two: run fdisk to find out the last used sector. Command:
sudo fdisk -l /dev/mmcblk0
Step three: get the 'end' sector from the last partition and enter it into the dd command below as 'count'. Run the dd command with a stop at the last used sector and correct bytes per sector set:
sudo dd bs=512 count=12281855 if=/dev/mmcblk0 of=/home/pi/Azle.iso status=progress