Wednesday, September 2, 2015

Duplicating Raspberry Image The hard Way

Compressed backup system

Insert sdcard containing working raspberry system
says it way detected as /dev/sdc/

copying the partition
sudo sfdisk -d /dev/sdc > partition.layout

mounting the sdcard
sudo mount /dev/sdc2 /mnt
sudo mount /dev/sdc1 /mnt/boot

compressing your system
cd /mnt
sudo tar cjvf /home/user/imagerpi-0000.tar.bz2 *

unmounting sdcard
cd ~
sudo umount /mnt/boot
sudo umount /mnt
unplug your sdcard

Installing on new fresh sdcard
insert new sdcard, with the same size or bigger says it also detected as /dev/sdc

copying partition
sudo sfdisk -f /dev/sdc < partititon.layout

formating partition
sudo mkfs.vfat /dev/sdc1 -n boot
sudo mkfs.ext4 /dev/sdc2 -L rootfs
sudo mkswap /dev/sdc3

mounting sdcard
sudo mount /dev/sdc2 /mnt

create boot directory
sudo mkdir /mnt/boot

mount boot partition
sudo mount /dev/sdc1 /mnt/boot

extracting your compressed image
cd /mnt
sudo tar xjvf /home/user/imagerpi-0000.tar.bz2
sync

unmount your sdcard
cd ~
umount /mnt/boot
umount /mnt

unplug your sdcard
test it on your raspberrypi  board.
Enjoy

No comments:

Post a Comment