On Feb 27, 2012, at 3:52 PM, Jim Meyering wrote:
> 
> For the record, I did this:
> (using GNU cp and GNU tar for their sparse-related options,
> and with 634764 being the (size in bytes of F) / 1024)
> 
>  dd if=/dev/zero of=F bs=1K seek=15 \
>    count=$((634764-16)) conv=notrunc
>  cp --sparse=always F AppleBoot.img
>  tar jcvSf - F2 > AppleBoot.img.tar.bz2
> 
> I'm pretty sure I could have trimmed 1 or 2KiB more off each end,
> but it wasn't worth it.

OK so I have:
  #       start sector        end sector 
   3       141034640       142304175   619.9 MiB   AB00  Recovery HD


dd if=/dev/sda3 of=abnew.img
dd if=/dev/zero of=abnew.img seek=30 \
   count=1269503 conv=notrunc
cp --sparse=always abnew.img abnew-sparse.img
tar jcvSf - abnew-sparse.img > abnew.img abnew-sparse.img.tar.bz2


Looks OK? This new partition is not exactly divisible by 1024 so I'm using 512 
byte blocks.

Chris Murphy

Reply via email to