Sample Header Ad - 728x90

Reading from stdin `dd` copies more data than reading the same thing from file

1 vote
0 answers
37 views
I encountered weird behaviour of the dd tool: 1. I downloaded compressed "newsystem.iso.xz". 2. I ran xz -d --stdout newsystem.iso.xz | dd of=/dev/sdb bs=1M conv=sync. 3. The decompressed "*.iso" file weights about 4.5GB. I expect this to fit on the usb. Instead dd fails 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: 1. dd if=newsystem.iso of=/dev/sdb bs=1M conv=sync 2. 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!
Asked by zaabson (33 rep)
Apr 16, 2022, 12:18 PM
Last activity: Apr 16, 2022, 12:28 PM