Wednesday, 26 March 2014

Raspberry pi backup SD card using linux

I use raspberry pi model B.

Due to my unstable power supply RPi had gone through many freeze/crashes.

This sudden change in voltage can corrupt SD card easily.

Restoring SD image and pop it back in, and save some downtime.

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=91&t=46911

    sudo dd if=/dev/mmcblk0 bs=4M | gzip > /home/your_username/image.gz

    gzip -dc /home/your_username/image.gz | sudo dd bs=4M of=/dev/sdb

--

for me

sudo fdisk -l
#Showed sdcard as /dev/mmcblk0
sudo dd if=/dev/mmcblk0 bs=4M | gzip >/media/my/RPIbackup'date +%y%m%d'.gz

#To restore
sudo fdisk -l
gzip -dc /home/your_username/image.gz | sudo dd bs=4M of=/dev/mmcblk0

No comments:

Post a Comment