Sample Header Ad - 728x90

How do I uncompress a file with lots of zeroes as a sparse file?

20 votes
3 answers
3688 views
I have a compressed raw image of a very large hard drive created using cat /dev/sdx | xz > image.xz. However, the free space in the drive was zeroed before this operation, and the image consists mostly of zero bytes. What's the easiest way to extract this image as a sparse file, such that the blocks of zeroes do not take up any space?
Asked by jaymmer - Reinstate Monica (835 rep)
Jan 3, 2022, 12:22 PM
Last activity: Feb 20, 2024, 07:27 AM