[Arm-dev] making a compressed image

Fri May 5 19:53:50 UTC 2017
Fabian Arrotin <arrfab at centos.org>

On 05/05/17 17:33, Robert Moskowitz wrote:
> I have worked out the dd command to copy my work in progress 4Gb image:
> 
> dd if=/dev/sdb of=cubietruck.img bs=512 count=6268927
> 
> and restore it with:
> 
> dd if=/home/rgm/arm/Centos/cubietruck.img of=/dev/sdb bs=4M; sync
> 
> But I would like to compress this, making a .xz file that is expanded
> with xzcat.
> 
> I have not figured this out, so am asking for a bit of help (I have had
> to increase the  root partition so backing up is a larger file now).
> 
> thanks
> 

well, "dd if=/dev/sdb| xz > file.xz " ?

I prefer using myself pxz for parallel compression.
As the tool we use to create the images just output raw .img file, we
compress those like this :
for file in *.img ; do echo "==== Compressing ${file} ======" ; time pv
${file} |pxz -T 16 > ${file}.xz ; done

Apply some salt/pepper to your needs and enjoy :-)
-- 
Fabian Arrotin
The CentOS Project | http://www.centos.org
gpg key: 56BEC54E | twitter: @arrfab

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.centos.org/pipermail/arm-dev/attachments/20170505/cefc8360/attachment-0006.sig>