assume file is "DDimage.img.xz", target device is "/dev/sda"
xzcat DDimage.img.xz | dd of=/dev/sda bs=1M
dd if=/dev/sda | xz -cz9 > DDimage.img.xz
please don't ask me why not multi-thread with xz, I don't know how to do.....
see the progress every 5's
watch -n 5 pkill -USR1 ^dd$