[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Fixing errors on a BTRFS partition?



On 12/01/2023 13:42, Nate Bargmann wrote:
I have a Freedom Box Pioneer (hardware is an Olimex A20-OLinuXino-LIME2
unit with a Samsung 128 GB micro-SD card.  The micro-SD is partitioned
into 2GB boot ext2 and the remainder as the root partition as BTRFS.

The thing has been crashing for months and now it started giving GPG
signature errors when trying to run 'apt update'.  I copied the entire
micro-SD card to an image file with dd so I have a backup.  Running
'btrfs check' resulted in a lot of errors so I ran the check and
directed the output to a file which is over 2MB in size!  The following
is a small snippet of what it in the file:

[1/7] checking root items
[2/7] checking extents (...)

Everything online hints that attempting repair is particularly
dangerous, but what else am I to do?  At the moment the system is pretty
much useless.

Hi Nate, your hardware has failed and corrupted files were detected by excellent checksumming functionality of Btrfs. Checksums stored does not match the file read, and error is shown. Additionally, access may be denied to a corrupted file, creating more problems. Its good that you created backup of the card, so you can recover things later if you really need to.

You don't have any redundancy on that single card, therefore recovering 100% of damaged files is impossible, your data is lost. Also, repairing filesystem to usable state (like deleting corrupted files and so on) will not fix underlying hardware issue. I suggest obtaining another card and installing system to it from the scratch.

To satiate your curiosity, you can find out what files are corrupted, some of the errors are giving filenames. If not, this is my saved command to obtain filename from inode numbers:
sudo btrfs inspect-internal inode-resolve 50845 /

And obtain filename from logical error:
sudo btrfs inspect-internal logical-resolve -v 540115857408 /

As far as I know, Btrfs may refuse to read file with wrong checksum, there may be another command to do that.

--
With kindest regards, Piotr.

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/
⠈⠳⣄⠀⠀⠀⠀


Reply to: