using clonezilla or partclone from the commandline to create a "sparse" img file

robert rottermann robert at
Tue Jun 30 15:07:15 UTC 2015

Hi there,

I would like to copy the contents of an sd-card that contains two 
partitions (actually a raspberry boot and data partition) into a file 
that later can be used to copy to an other sd-card .

using a python script, this works well when I just open the device 
pointing to the sd-card (like /dev/sdc) as a file, and the copy its 
content to a disk file.
to restore it, I copy that disk file to the device again.

However, this approach has  big disadvantages:
my disk file is exactly as big as the the sd-cards capacity.
And, worse, to copy it back again, I need a sd-card with the same 
capacity as the original one.

I hope to find tools that would allow me to create such "sparse" copies.
It looks, as if partclone is such a tool.
Unfortunately I found no description how it could be used from the 
command line.

can sombody of you point me to such a documentation/tutorial,
or better yet: tell me what is the right way to dump an sd card into an 
img file.
I know dd, ..


More information about the ubuntu-users mailing list