Imaging Hard Drives

Bernie Hoefer LUG-Member at TheMoreIKnow.info
Mon Aug 29 11:29:03 EDT 2016


On 2016-08-29 08:10 EST, Kevin Hunter Kesling wrote:
===
> Knowing this, you can prepare a device prior to taking an
> image so that you can store your image a lot more efficiently.
> Basically, write a bunch of zeros to a file, then delete that file, then
> take your image.  In CLI:
> 
>     $ dd if=/dev/zero of=./big_empty_file_of_zeros bs=1M
>     ... No space left on device
> 
>     $ rm ./big_empty_file_of_zeros
> 
>     $ dd if=/dev/sdX bs=1M | pigz > img.gz
===

     Kevin, thanks for the pigz trick!  I didn't know about that tool.
     I still prefer partimage over your recommendation because partimage
does not have to zero out the empty blocks.  It `sees` that a block is
free and thus doesn't even read it.
     I also like how partimage will optionally break the partition image
up into files of a user-specified size.  I got in the habit of creating
partition images composed of 2GiB-sized files back when I'd sometimes
have to store them on a FAT16-formatted file system.  (The max file size
for FAT16 is 2GiB when it uses the default cluster size.)

     The partimage website actually has a short list of other reasons
why they believe partimage is better than zeroing-out-then-dd in their FAQ:

<https://www.partimage.org/Partimage-FAQ#What_does_partimage_give_you_over_the_following:_clear_the_free_blocks_with_DD.2C_and_copy_with_DD>

-- 
Bernie Hoefer
PGP e-mail is welcome!  Get my 1024 bit signature key from:
<http://pgpkeys.mit.edu/pks/lookup?op=get&search=0x446A6F93>.
"The more I know, the more I realize how much I do not understand."

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.cinlug.org/pipermail/cinlug/attachments/20160829/849eaa1b/attachment.sig>


More information about the cinlug mailing list