BTRFS broken and system won’t boot

Basically after restarting my system, it won’t boot past grub and I’m presented with the first picture.
I suspect its a btrfs problem due to the dmesg logs.

This persists even when tying with an lts kernel or any btrfs snapshots that were previously created.
Also I tried booting from a live system to run a btrfs check and repair however I’m unable to even mount the partition. (Running a check with gparted also doesn’t work)

Any kind of help would be much appreciated as I’m stumped and in the middle of uni exams.

Firs of all welcome @Capsized to the wonderful EndeavourOS and its wonderful community.

I suspect it is Grub!
You will find lots of posts here about the Grub issue.
I am sure you will find amazing support her and you will get your system up and running again.

Yes. Looks like btrfs filesystem corruption from that output.

Running btrfs check is run when the filesystem isn’t mounted so that shouldn’t be a problem.

Thx for the response.
Ok so it ran from the system itself not the live iso.
Should I go ahead and try a —repair?

I don’t have the low level btrfs knowledge to answer that question.

However, I do know that repair can often make things worse.

I would carefully read the documentation here before proceeding:

Not sure if it is possible to mount that partition now after the file system check but if it is I would mount it and back up whatever personal data you might have on it before taking any other action.

1 Like

Ok so I went along with it as I couldn’t manage to mount the partition and any important data was stored on another drive.
After running the repair I typed exit and it some how put me onto the sddm login screen where I was able to start kde.
However is there a way to check if there’s still any existing errors or the cause of this?

1 Like

You can run btrfs check to see if there are still errors.

As for what caused it, it is hard to say. The most common cause is power loss while the device is mounted. This can happen by hard power off(holding the power button) or losing power some other way.

It can also be caused by hardware failures, most commonly with the disk itself.

Congratulations, you seem to have rescued your capsized HMS Endeavour @Capsized.
Welcome to EnOS’ community!

:enos_flag: :handshake:t5:

1 Like
➜  ~ sudo btrfs check --force /dev/nvme0n1p3
Opening filesystem to check...
WARNING: filesystem mounted, continuing because of --force
Checking filesystem on /dev/nvme0n1p3
UUID: 8b2e68f2-7032-44c0-9388-65803d85cb3c
[1/7] checking root items
[2/7] checking extents
checksum verify failed on 1015431168 wanted 0x06f69e21 found 0xd0f44553
checksum verify failed on 1015447552 wanted 0x58fdf3c0 found 0x4ebe54ff
[3/7] checking free space tree
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
found 126871011328 bytes used, no error found
total csum bytes: 121834100
total tree bytes: 1861550080
total fs tree bytes: 1595654144
total extent tree bytes: 115032064
btree space waste bytes: 343352628
file data blocks allocated: 167377965056
 referenced 194751684608

So everything appears to be fine so far but there are 2 checksum fails. Should this be a concern?
Otherwise thanks for the replies.

Try to identify which files are bad.

$ sudo btrfs inspect-internal logical-resolve 1015431168 /
$ sudo btrfs inspect-internal logical-resolve 1015447552 /

Out of curiosity, how did the file system get corrupted?

Did you force your PC to shutdown while Btrfs was processing e.g. Btrfs defragment?

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.