Backup Raspberry Pi Data To A USB Pen
Creating a backup of your Raspberry Pi data is essential, and following the steps below will help ensure your backup is both safe and secure.
- Connect the USB drive to your Raspberry Pi.
- Open a terminal and find your devices using
lsblk
orsudo fdisk -l.
Identify your SD card/dev/mmcblk0
and the USB drive/dev/sda
. - Run the backup command:
sudo dd bs=4M if=/dev/mmcblk0 of=/dev/sda status=progress
- Replace
/dev/mmcblk0
with your source SD card and/dev/sda
with your destination USB drive. bs=4M
sets the block size for faster copying.status=progress
shows the progress of the operation.- Wait for the command to complete. The command prompt will return, and you can then safely remove the USB drive.