Saturday, February 16, 2013

I need a backup

How to do a backup?

Well we have our micro SD working fine, with all the libraries that wee need

As could be the OpenCV library, but I have to try to modify the compilation that I made in Cubieboard + openCV, and we have a small risk to make some mistake and the process to install should to start.

To avoid this problem, I am going to do a backup of the micro SD, it is quite simple in Linux. I don't know Windows, but if some can do it please leave a comment.

.- Take out the micro SD and with an USB adapter connect to the computer

ikaro@nirvana ~ $ dmesg
[ 2298.045043] sd 3:0:0:0: [sdc] 15548416 512-byte logical blocks: (7.96 GB/7.41 GiB)
[ 2298.050815]  sdc: sdc1 sdc2
[ 2298.053659] sd 3:0:0:0: [sdc] Attached SCSI removable disk

The card has two partitios

ikaro@nirvana ~ $sudo fdisk /dev/sdc

Disk /dev/sdc: 7960 MB, 7960788992 bytes
245 heads, 62 sectors/track, 1023 cylinders, total 15548416 sectors
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048      131071       64512    e  W95 FAT16 (LBA)
/dev/sdc2          131072    15548415     7708672   83  Linux

So we want to duplicate the micro SD

With all this information we can continue to clone / duplicate / backup

ikaro@nirvana ~ $ dd bs=1M if=/dev/sdc of=raspbery_Cubie.img

I have tried with bs=4M but the backup did not work.
This command take a few minutes.

But finally will have our backup from the micro SD

ikaro@nirvana ~/backup_cubieboard $ ls -lh
total 7,5G
-rw-r--r-- 1 ikaro ikaro 7,5G 2013-02-16 10:40 raspbery_Cubie.img.

Now we have to put this image into a new micro SD, at last of the same size and we can put the image into it

ikaro@nirvana ~ $ dd bs=1M  if=raspbery_Cubie.img of=/dev/sdc

And we will have the backup done.

I know it is a process simple, but it very useful

And if you want to make a NAND Flash backup it quite easy too, from raspbian.

 dd if=/dev/nand of=/some/place/with/enough/space

No comments:

Post a Comment