Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Okay, so what's the best way to image an SD card then? I use the following on a 64gb SD card -- is there a better way?

    dd if=/dev/sda | gzip > img.gz
    dd if=img.gz  | gunzip | dd of=/dev/sda


Do these not work?:

    gzip < /dev/sda > img.gz
    gunzip < img.gz > /dev/sda
Those should give you better block sizes than default dd without bs=128k or whatever.


For your first command:

    gzip -c /dev/sda > img.gz
For your second command:

    gunzip -c img.gz > /dev/sda
are what I suspect the blog post would recommend.


I would install pv (optional) and do

cat /dev/mmcblk0 | pv -abtrN Processed | gzip > img.gz

cat img.gz | gunzip | pv -abtrN Processed > /dev/mmcblk0


this is not the point of the article, but you may want to specify blocksize in those commands? ymmv tho




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: