I encountered weird behaviour of the dd tool:
- I downloaded compressed "newsystem.iso.xz".
- I ran
xz -d --stdout newsystem.iso.xz | dd of=/dev/sdb bs=1M conv=sync. - The decompressed "*.iso" file weights about 4.5GB. I expect this to fit on the usb. Instead
ddfails with "Not enough space" error, saying that it wrote 8.1GB (the usb is about 8GB)
But then I downloaded the already decompressed "*.iso" and ran:
dd if=newsystem.iso of=/dev/sdb bs=1M conv=sync- Command succeeds after writing the expected 4.5GB.
I can verify that xz -d --stdout newsystem.iso.xz | shash512sum is the same as shash512sum newsystem.iso.
The sync option means
sync pad every input block with NULs to ibs-size
The dd version is "GNU coreutils 9.0" and the iso image is "FreeBSD-13.0-RELEASE-amd64-dvd1.iso".
Thanks in advance!
cat "newsystem.iso" | dd of=/dev/sdb bs=1M conv=sync. – zaabson Apr 16 '22 at 12:20iflag=fullblock. – Stephen Kitt Apr 16 '22 at 12:30conv=syncdoes on incomplete reads from a pipe, it does not make sense here and you probably want to avoid it in general – frostschutz Apr 16 '22 at 12:55