vendredi 22 janvier 2016

[Beginner's Guide] - Cloning and restoring your Raspberry Pi's MicroSD

Why am I cloning it ?


I had a lot of stuff going on on my RPI.

I typically use it for prototyping and development.

Quite a lot of my ongoing projects on it.

So, I figured out that I should probably write about how easy it is to backup and restore your RPI.

Also, some of our fans complained that the stuff we did was not for the average joe.

Tried to make it as simple as possible !


Higher Capacity MicroSDHC card


Recently acquired a higher capacity microsd card from Toshiba - total cap 32GB, 40Mb/s Read/Write. (I had an old 16GB which quickly filled up to 10.5GB).

One of the reasons I am writing this is because I needed to change that old MicroSD.

Lets get on with it


So here we go.
1. Mount your microSD. (from a card reader of course!) - cheap ones at fastclick bagatelle
Should automount on inserting it.

2. Check your drive name/id - 
sudo fdisk -l

That command will list all the drives. Mine is 16GB so just check the side to know the mount point.
Mine was /dev/mmcblk0

3.Back it up (clone)
sudo dd bs=4M if=/dev/mmcblk0 of=/home/devildron/backup.img

So dd(disk dump) makes the image of /dev/mmcblk0 and stores the image to my folder /home/devildron/

4. Restore
Insert your new SD card.
then run this command:
sudo dd bs=4M if=/home/devildron/backup.img of=/dev/sdb



UPDATE:
Just tested the cloned RPI
pi@raspberrypi:~ $ uptime 14:09pm  up   0:06,  2 users,  load average: 0.01, 0.18, 0.12

Made it simpler and corrected a few mistakes i made

Thats it !
Have fun playing with RPI !




Aucun commentaire:

Enregistrer un commentaire