You are not logged in.

#1 2026-08-19 01:28:17

alysher
Member
Registered: 2017-07-31
Posts: 59

Failed to mount btrfs drive on boot, need advice on what to do next...

When I booted my PC this morning Arch dropped me into maintenance mode:

this was the error on screen:

BTRFS error (device dm-0): parent transid verify failed on logical 119717888 mirror 1 wanted 5501 found 5499
BTRFS error (device dm-0): parent transid verify failed on logical 119717888 mirror 2 wanted 5501 found 5499
BTRFS error (device dm-0): failed to run delayed ref for logical 76169216 num_bytes 16384 type 176 action1 ref_mod1: -5
BTRFS error (device dm-0 state A); transaction aborted (error -5)
BTRFS: error (device dm-0 state A) in btrfs_run_delayed_refs:2162: errno=-5 IO failure
BTRFS: error (device dm-0 state EA) in btrfs_replay_log:2072: errno=-5 IO failure (Failed to recover log tree)
[FAILED] Failed to mound /games

I removed said device from fstab and had the system continue booting, I have ran btrfs check and it reports the same parent transid error along with a bunch of other stuff im not entirely sure about - repeated entries of

extent item ######## has multiple extent items

and

backpointer mismatch on [######## #####]

where ######## represent sector id's, I think.

I am not sure what my next step is here....do i run --repair or is there another tool i need to check first?


I started learning linux under Debian, and this is what I hope for every time I interact with the awesome Arch community.

Offline

#2 2026-08-19 16:03:42

xerxes_
Member
Registered: 2018-04-29
Posts: 1,076

Re: Failed to mount btrfs drive on boot, need advice on what to do next...

First of all - DO BACKUP of your valuable files to other drive (if you don't have it yet) from your installed system or booted live Arch Linux, for example like this:

(sudo) btrfs restore -D, -u 0/1/2 /dev/sdX
(sudo) btrfs restore -u 2 /dev/sdX /path/to/save/filesto

Details with other options in 'man btrfs restore'.

Then you can try to examine and understand what happened to not doing things blindly and not make it worse; you may try to use btrfs tools and commands, for example like those:

(sudo) btrfs inspect-internal dump-super -a /dev/sdX
(sudo) btrfs inspect-internal dump-super -f /dev/sdX
(sudo) btrfs inspect-internal dump-tree -t 5 /dev/sdX
(sudo) btrfs inspect-internal list-chunks ...
(sudo) btrfs subvolume list -t /mount_point

You may find better combinations of options in 'man btrfs inspect-internal'.

And when you find out what happened, then you may act precisely.

Do you have some lvm device(s) with some btrfs raid type?

Last edited by xerxes_ (2026-08-19 16:08:49)

Offline

#3 2026-08-19 17:34:07

topcat01
Member
Registered: 2019-09-17
Posts: 349

Re: Failed to mount btrfs drive on boot, need advice on what to do next...

As to the cause: it's almost certainly a hardware issue. Either the disk is failing or there was an unclean shutdown and the disk does not have working write barriers/lies about sync. In addition to the above helpful suggestions, you can try

btrfs rescue zero-log /dev/ice

and see if it will mount.

Offline

#4 2026-08-19 23:03:00

alysher
Member
Registered: 2017-07-31
Posts: 59

Re: Failed to mount btrfs drive on boot, need advice on what to do next...

Thanks for the replies guys. BTRFS has its quirks, and when the wiki says check other tools first before running --repair, its best to follow that advice, and any further input given.

as for that input:

topcat01 wrote:

As to the cause: it's almost certainly a hardware issue. Either the disk is failing or there was an unclean shutdown and the disk does not have working write barriers/lies about sync. In addition to the above helpful suggestions, you can try

btrfs rescue zero-log /dev/ice

and see if it will mount.


uh, ya, its a distinct possibility that i had an unclean shutdown event of some sort, when i shut it down the night before it took an abnormal length of time to do so.

xerxes_ wrote:

First of all - DO BACKUP of your valuable files to other drive (if you don't have it yet) from your installed system or booted live Arch Linux, for example like this:

Much as i would love to do this...i cant. its an 8TB drive and the largest i have. even combining all the spare drives I have at this point, it wouldnt reach the needed space. It was housing mostly steam games and rips from my personal movie collection. Re-doing the work to get the movies is only going to be time consuming at this point, and steam games will re-download. I've resigned myself to losing what i had there if i cant get it fixed.

Topcat, Xerxes, thank you for your input. I will see where the next steps take me, and report back.


I started learning linux under Debian, and this is what I hope for every time I interact with the awesome Arch community.

Offline

#5 2026-08-20 03:01:12

alysher
Member
Registered: 2017-07-31
Posts: 59

Re: Failed to mount btrfs drive on boot, need advice on what to do next...

xerxes_ wrote:

...You may find better combinations of options in 'man btrfs inspect-internal'.

I ran through the list of commands you suggested, and though anything else i could find that could be relevant in 'inspect-internal'.

...And when you find out what happened, then you may act precisely.

I could not find anything that looked out of place. the drive responded appropriately to all requests, nothing in journalctl about any sort of issue as it accessed and read the drive. I am forced to conclude it was an unclean shutdown event.

Do you have some lvm device(s) with some btrfs raid type?

Na, not for this drive. its single spinning HDD that i purchased specifically to hold my games and media. First time i've ever had an issue.


topcat01 wrote:

...and see if it will mount.

It mounted. Zeroing the log(which is what i think that command did) has me looking at my files and verifying them as I type this. Looks like everything is still there, so maybe no ill effects... i suppose fsck should be run on it as well.

Any other suggestions on commands i should run before next shutdown. im pretty sure i can manually dismount it any time and remount it, but before any actual use id like to verify its healthy.

Last edited by alysher (2026-08-20 03:01:44)


I started learning linux under Debian, and this is what I hope for every time I interact with the awesome Arch community.

Offline

#6 2026-08-20 03:08:32

topcat01
Member
Registered: 2019-09-17
Posts: 349

Re: Failed to mount btrfs drive on boot, need advice on what to do next...

Not sure why the shutdown was improper, or indeed what exactly happened, but I take the following steps to mitigate against buggy firmware (surprisingly common) which does not honour write barriers (this is a hard requirement for btrfs metadata consistency):
1. Disable the disk's write cache using hdparm (via a udev rule).
2. Use the flushoncommit mount option.
You should run a readonly check, and also (more importantly) a scrub. If no errors are reported, then it's a safe bet that no data was lost, except maybe be the last few writes during shutdown.

Last edited by topcat01 (2026-08-20 03:09:15)

Offline

Board footer

Powered by FluxBB