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
lsblkorsudo fdisk -l.Identify your SD card/dev/mmcblk0and the USB drive/dev/sda. - Run the backup command:
sudo dd bs=4M if=/dev/mmcblk0 of=/dev/sda status=progress - Replace
/dev/mmcblk0with your source SD card and/dev/sdawith your destination USB drive. bs=4Msets the block size for faster copying.status=progressshows 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.