PINE64
clone copy of sd card by using partclone - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Linux on Pine A64(+) (https://forum.pine64.org/forumdisplay.php?fid=6)
+---- Forum: Debian (https://forum.pine64.org/forumdisplay.php?fid=24)
+---- Thread: clone copy of sd card by using partclone (/showthread.php?tid=2664)



clone copy of sd card by using partclone - hatahata - 11-03-2016

Hi all

sd card is /dev/sdc Exclamation .

1) backup

dd if=/dev/sdc of=~/Pine-mate-MBR.img bs=512 count=10000

partclone.vfat -c -s     /dev/sdc1          -o    ~/Pine-mate-sdx1of3.pcl

fsck /dev/sdc2

partclone.ext4 -c -s     /dev/sdc2          -o    ~/Pine-mate-sdx2of3.pcl



and then i put anothe sd card  into USB . Exclamation


2)restore

dd if=/root/Pine-mate-MBR.img of=/dev/sdc bs=512

partclone.vfat -r -s /root/Pine-mate-sdx1of3.pcl -o /dev/sdc1

partclone.ext4 -r -s /root/Pine-mate-sdx2of3.pcl -o /dev/sdc2

mkswap /dev/sdc3

---------------------------
all is done . Big Grin

this is much faster by using dd . Heart
----------
regards


RE: clone copy of sd card by using partclone - MarkHaysHarris777 - 11-03-2016

Interesting...


RE: clone copy of sd card by using partclone - hatahata - 11-03-2016

(11-03-2016, 09:09 PM)MarkHaysHarris777 Wrote: Interesting...

thanks for reply .

about  
dd if=/dev/sdc of=~/Pine-mate-MBR.img bs=512 count=10000

10000 is too big .
i don not know best value  .

and
this line hard copy of MBR(?) and partition structure . Idea
if you want full size of partition 1  , you should use gparted Tongue .

and this method is applicable for btrfs arch linux Heart  (partclone.btrfs)

--------------
regards


RE: clone copy of sd card by using partclone - dkryder - 11-03-2016

what do you mean by USB?
what about the FIRST SD card, are there still open files when you remove it?
why do you never use command sync?


RE: clone copy of sd card by using partclone - hatahata - 11-03-2016

(11-03-2016, 10:02 PM)dkryder Wrote: what do you mean by USB?
what about the FIRST SD card, are there still open files when you remove it?
why do you never use command sync?

arch linux PC:USB port------ Exclamation sd card reader Exclamation ------sd card in which pine64 lives .

no,
cloning to img , and then clone to another sd card .
so mass productin is easy Angel .


in btrfs , rsync is impossible
1)btrfs cloning itself
https://youtu.be/eFfKmEh6KO8
2)and then gparted
https://youtu.be/wRpEqggWS8w

---
regards


RE: clone copy of sd card by using partclone - MarkHaysHarris777 - 11-03-2016

This actually has some cool application:  if we start providing a service ( like noobs on Raspberry PI ) to mail out SD cards for folks that don't want to go to the trouble of making their own.

difinitely worth looking into.


RE: clone copy of sd card by using partclone - pfeerick - 11-04-2016

(11-03-2016, 10:17 PM)hatahata Wrote: in btrfs , rsync is impossible

sync, not rsync. And it is probably a good idea to do it before removing the target microSD, just in case you yank it out as it's finishing flushing the buffers to disk... although the flashing light (if there is one) on the microSD card reader is usually a giveaway that it hasn't really finished yet. Wink