I have a 6.3G filesystem dump that I've been trying to compress using squashfs, but after using unsquashfs
, the generated file is different from the original dump.
I generated a difference between the original file and the file in the squashfs system with the following command:
cmp -l /media/daboross/extstorage/backup-2014-12-05/sda7_backup.img \
/media/daboross/disk/sda7_backup.img \
| gawk '{printf "%08X %02X %02X\n", $1, strtonum(0$2), strtonum(0$3)}' \
> diff.txt
where /media/daboross/extstorage/backup-2014-12-05/sda7_backup.img
is the original file and /media/daboross/disk/
is a mount of the squashfs file. See https://superuser.com/a/125408 for the source of this command.
Here's the generated diff file: http://sprunge.us/BFPS. There might be some pattern in this that can help diagnose the problem, I'm not sure what it would be, but including this just in case.
If there's any information that would be helpful, feel free to ask for it. I don't currently have the squashfs filesystem that generated that that difference file was generated from, but I can just run mksquashfs
again if need be - it is consistently creating a file which isn't the same.
The version of mksquashfs/unsquashfs (from squashfs-tools):
mksquashfs version 4.2-git (2013/04/07)
unsquashfs version 4.2-git (2013/03/13)
Any ideas on why this occurs or what I can do to help are greatly appreciated.
Edit/Update:
After upgrading from the version of squashfs-tools packaged with Ubuntu to squashfs v4.3, I still get an error, but not as much of one.
Running the above binary diff command produces this for the file compressed and decompressed using v4.3: http://sprunge.us/DDAM.
If you look at the binary diff files you see that the diff file produced with v4.3 is exactly the same as the last part of the file produced with 4.2-git. I would guess this probably means that part of the corruption was fixed in v4.3, but not all of it.