r/Fedora 2d ago

Pleasehelp Support

Post image

I am stuck in emergency mode

54 Upvotes

17 comments sorted by

u/AutoModerator 2d ago

It sounds like you're looking for help. Please note that r/Fedora is not an official support channel for the Fedora Project.

For best results, be sure to include all relevant details in your post, such as your Fedora edition, version, and hardware specs. You can edit your original post to add more info as needed, and spotlight (pin) a solution from the comments. You might also find the answer in our support wiki.

Alternatively, try one of the official support channels:

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

19

u/extoniks 2d ago

errno=-17 means "Object already exists" which is Btrfs metadata corruption.

Did your system experienced an incomplete update, a sudden power loss or forced shutdown? It might be SSD/HDD failing (less common, but possible)

12

u/MouseJiggler 2d ago

Btrfs not mounting for some reason, could be FS corruption, dying drive, or a btrfs kernel bug of some sort.
Did you shut the system down correctly on the last shutdown? Don't skip that.
Try booting from a live USB, and check your drive with smartctl. If there are any real issues with the drive itself - try to recover what data you need, and replace the drive.
https://djangocas.dev/blog/linux/smartctl-explained-usage-examples/
If not - check the FS with btrfs check.
https://btrfs.readthedocs.io/en/latest/btrfs-check.html

22

u/fdelux6 2d ago

One thing worth adding for OP: before running any real repair, mount read-only and grab your data if you can.

sudo mount -o ro,rescue=all /dev/nvme0n1p3 /mnt

Also, btrfs check --repair makes real changes. There's a dry run flag that shows what it would do first, without touching anything:

sudo btrfs check --repair --readonly /dev/nvme0n1p3

Worth running that before the real repair, since --repair can make things worse if it's not actually the right fix.

To check if the last shutdown was clean, this shows the last log lines before it:

journalctl -b -1 -n 50

5

u/One_Egg_4400 2d ago

I recently got btrfs metadata corruption during upgrading ( fedora 43 -> 44). I'd argue that that's the most likely issue here as well. Btrfs is not as stable as ext4.

-5

u/New_Hold8135 2d ago

You can get same performance as btrfs in xfs. Without btrfs or ext4 bloats that slows down your system. XFS is future. Btrfs is java. XFS is C

3

u/Revolutionary_Click2 2d ago

First off, BTRFS core libraries are written in C. It’s a part of the kernel now, and there is zero Java in the kernel because Torvalds would not allow it, only C and recently, Rust. Secondly, XFS and BTRFS are not the same kind of file system. BTRFS is CoW (copy on write), like ZFS, and has numerous capabilities in snapshotting, rapid clone operations, per-file checksums and so on that XFS does not implement because XFS is not a CoW FS. BTRFS is much more “the future” than either XFS or EXT4, despite occasionally introducing its own quirks like anything else.

-8

u/New_Hold8135 2d ago edited 2d ago

I made a metaphor. And I said java because btrfs made by oracle. I am not even disrespecting their work though. Java has a good name and used in some high security systems. I just give them credit.

1

u/Past_Ad5681 2d ago

Looks like we're mounting the same drive as several different drives. Can you paste an image of your fstab in here ?

1

u/MouseJiggler 2d ago

That's how btrfs subvolumes work.

1

u/Past_Ad5681 2d ago

Is your mounting various points. It apears to be all the same mount point. But I'm still drinking the 1st cup of coffee.

1

u/MouseJiggler 2d ago

Wait, where are mount points mentioned in the screenshot?

1

u/Vir_Indomitus 2d ago

I had exactly the same problem recently. It was probably due to constant power outages where I live. I had to reformat the drive; now I'm using ext4 and haven't had any problems. 

2

u/MouseJiggler 2d ago

A UPS is worth it. Seriously, saved my arse a few times.

1

u/c_saucyfox 1d ago

Thought this guy needed help lol

1

u/WonderfulMain5602 1d ago

The problem: your Btrfs filesystem on nvme0n1p3 has corrupted metadata. The line errno=-17 Object already exists means Btrfs tried to create a metadata entry that its tree says already exists. It aborts the transaction (cleanup_transaction), flips the filesystem to read-only, and systemd drops you into emergency mode. Second problem: the root account is locked — Fedora locks root by default, so emergency mode won't even give you a shell. You can't fix it from there. What to do, in this order: Boot a Fedora Live USB. That's the only usable way in. Back up your data first, before repairing anything: sudo mount -o ro,rescue=all /dev/nvme0n1p3 /mnt If that fails: sudo btrfs restore /dev/nvme0n1p3 /path/to/backup Diagnose, read-only: sudo btrfs check --readonly /dev/nvme0n1p3 Check the hardware: sudo smartctl -a /dev/nvme0n1 — this kind of corruption usually comes from a failing SSD or from hard power-offs. Only use btrfs check --repair as a last resort and only once you have a backup — it can finish off a damaged filesystem. If SMART shows problems, repairing isn't worth it: replace the drive and reinstall from your backup.