Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dd a compressed *.xz image into a partition

I'm trying to copy a compressed image into a partition inside a Beaglebone. Usually, it is a 2 step process:

xz -d console.img.xz # console.img is created
dd if=console.img of=/dev/mmcblk0p3

Is there a way, I can do it in a single step without uncompressing the file *.img.xz? This is because after uncompressed the image, it is too big for the current partition.

like image 691
Sayanee Avatar asked Jan 05 '18 08:01

Sayanee


2 Answers

xzcat console.img.xz | dd of=/dev/mmcblk0p3 status=progress

xz -dc console.img.xz | dd of=/dev/mmcblk0p3 status=progress

like image 156
Lev Lybin Avatar answered Oct 30 '22 15:10

Lev Lybin


This seems to work, if that is what you mean:

xz -d < console.img.xz - | dd of=/dev/mmcblk0p3
like image 42
Mark Setchell Avatar answered Oct 30 '22 15:10

Mark Setchell