On 10/27/2025 11:55 PM, Chris Murphy wrote:
On Fri, Oct 24, 2025, at 6:32 PM, home user via users wrote:
[snip]
It depends.  If you do:

dd if=/path/to/file count=2 2>/dev/null | hexdump -C

That will not show evidence of compression because the compression is 
transparent. All files appear to not be compressed as far as user space is 
concerned.

dd if=/dev/sdXY skip=$tosomeblock count=2 2>/dev/null |hexdump -C

Now you're reading blocks off the drive, outside the file system, and yes it 
will show compression but this is pretty tedious you need a specific physical 
address for this file which can only come from finding its logical address in 
Btrfs address space and then pass it through chunk tree lookup to find out what 
device and physical sector it's on (which is confusingly referred to as LBA 
because the drive also has logical addressing which we call physical sectors, 
but internally it does really have physical sectors but with an address space 
we have no access to).

It might be true data recovery is harder if the data is compressed, in that 
more data is potentially corrupt if there's a bit flip on compressed data than 
uncompressed data. It's surely better to mitigate this with backups than not 
compressing though.

The situation was somewhat different.

1. I did back-ups by using the file browser to copy a large sub-directory from the hard drive to a USB stick.  I do not know what the file browser did under the hood: cp? dd? something else?

2. Weeks later, on a windows-10 box, I was trying to recover specific files from the back-up.  I don't know with certainty what happened, but windows and/or the port or possibly something else damaged the back-up.  (There are other possibilities.)

3. Later, after the old Fedora desktop was re-installed, I (with serious help) tried again to recover a few key text files from the back-up.  ddrescue was used to get the stick contents copied to an iso file on the hard drive.

4. I thought that if I could use a hex editor (like "bless" or "ghex", not a hex dump) on the iso file, I could recognize the desired text file within that iso file, and copy the desired contents into a new text file.  The hex editor provides ASCII text search, hex addresses, and selection capabilities, all of which would make the method work easily.  It almost did work.  What killed the attempt was that there were a huge number of copies of the file in that iso file, and I could not determine which copy was the most recent.

Had the files on the stick been compressed, I would have had no chance of trying the above.

I have no doubt that compression is good for many things in many circumstances.  But it can cause problems.

--
_______________________________________________
users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to