Stuck in emergency mode after dirty shutdown

Good afternoon, i have stuck in emergency mode on boot after running journalctl -b -p 3 i see this:
btrfs error (device sda3): level verify failed on logical 733396992 mirror 1 wanted 1 found 0

Parent transid verify failed on 733396992 wanted 436 found 420
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=737034240 item=1 parent level=2 child bytenr=733396992 child level=0
ERROR: failed to read block groups: Input/output error
ERROR: cannot open file system

I have already tried btrfs rescue zero-log /dev/sdb3
But no result yet, still stuck on it, please help i just tired of reinstalling this system for 4 times already :c

I need to ask about the shutdown, Why was it cut off or “dirty” as you referenced?

there’s a mismatch between expected and actual data integrity levels within the filesystem.

Do you have access to a Live USB so you can potentially repair the system?

I have live usb, but when i select troubleshoot, it doesnt sees the disk, and it was a regular shutdown no actions have done, maybe easyeffects which starts after boot made a problem

I’m sorry, but I think you are misunderstanding what Troubleshoot in the LiveUSB means. That mans you troubleshoot the LiveUSB, not your system. This is a feature to troubleshoot issues related to the image you burn onto the LiveUSB.

We are going to need more information as to what happened, and if you are familiar with using the LiveUSB to mount your system with, including getting to the desktop and opening a terminal to enter commands to potentially restore thesystem. As I asked earlier, what do you mean by “Dirty Shutdown” ? Also, if you can explain what happened in more detail.

By “dirty shutdown” i mean system shutdown when background actions still happening.

And you mean reach terminal on liveUSB or actual system i have problems with?

That does not sound like a fedora app. Is It?

An unclean shutdown may corrupt the file system as your messages seem to show.
Booting to the live media may allow recovery with btrfs tools but do not just haphazardly run commands. Doing so may cause more damage.

I am sure others here that have more experience with btrfs than I may be able to assist.

I believe the troubleshoot option on the live media is not intended to assist with troubleshooting a failed system. It instead seems intended to assist where there are problems booting that media, usually due to graphics issues. You actually have to boot to the live media environment where you can then perform troubleshooting and repair tasks.

Exactly, so you can run some commands to hopefully restore your system. It’s clear to me you have a corrupt Filesystem right now, and you will need to get to the LiveUSB, boot the environment, Launch a Terminal and mount your BTRFS system to initiate a recovery.

There are things you can do in Read-Only mode to aid in the recovery, but I have some doubts looking back through your comments. . .

  • Yes there are command line things to do with BTRFS to help you repair the filesystem in Read-Only mode but it comes with risk :fire: mount -t btrfs -o ro,recovery /dev/sdb3 /mnt/recovery :fire:

  • You mentioned in the Original Post, you have done this 4x !!! . . . I’m more concerned if you have a Hard Drive issue with Bad Blocks. . . There also seems like a lot going wrong if 4 times you have had problems.

Proceed with Caution

After you have checked the system from the command above, You can run more things to help repair the filesystem :fire: btrfs check --repair :fire:

I checked my HDD before installing and it has only 1 bad sector

1 Like

Do I understand that right that you can enter the root password and then get a shell prompt? And then you run the journalctl command.

Ok, now run this command but,

How can i avoid this problem in future?

No i wasnt entering any password in emergency mode

The sarcastic answer would be to avoid

But in all fairness, this can happen for many reasons, like Power failure and Outages and hardware failure. I would moreso be prepared for when they happen. Back up your files constantly and get familiar with btrfs commands to recover, snapshot, back up the system.

Results: mount: /mnt/recovery: can’t read superblock on /dev/sdb3. (i have sdb3 because i use external drive)

:thinking: So you have Fedora running on an External USB drive? This might seem silly, but did you bump the drive on the USB port ? ( I ask because that has happened to me. . . ) Potentially causing a bad connection while the system was running?

I need to re-ask since you never replied to this. . .

Why have you tried 4x ? what has happened ?

No, drive is safe place where it cant lost connection

And i had to reinstall system 4 times because i got used to arch where drive rescue was automated, and i got confused and in panic was trying everything i could find to solve the problem but it got worse until it wont even boot in emergency mode

1 Like

So what i have to do, run second command you gived?

1 Like

Well you have given us more information now :

  • I checked my HDD before installing and it has only 1 bad sector

  • Results: mount: /mnt/recovery: can’t read superblock on /dev/sdb3. (i have sdb3 because i use external drive)

I would try btrfsck /dev/sdb3 this command will detects errors, it may prompt you to fix them. Follow the prompts carefully.

It only gived me info i posted earlier in thread description…
“Parent transid verify failed on 733396992 wanted 436 found 420
Ignoring transid failure
ERROR: child eb corrupted: parent bytenr=737034240 item=1 parent level=2 child bytenr=733396992 child level=0
ERROR: failed to read block groups: Input/output error
ERROR: cannot open file system”

Uhh
Should that not be btrfsck /dev/sdb3? After all he said sdb3 in the snippet you quoted.

2 Likes

Just checked and fixed my typo. :ballot_box_with_check: Thanks.

@lavender I just updated the commands to match the drive you have the issues on. please recheck.

If you still have the Bad Superblock issues there are more things BTRFS can do, since it does keep metadata and can potentially repair it, but please rerun with the right sdb3 first.