Dropped to emergency rootfs after an unclean shutdown

Hello,

At first my computer froze, so I forcefully shut it down. On the next boot, the system dropped me into the emergency rootfs shell. How can I fix this?

:: running early hook [udev]
:: running hook [udev]
:: Triggering uevents...
[    0.931294] wmi: Failed to parse WDG method
:: running hook [keymap]
Loading keymap...done.
:: running hook [encrypt]
:: performing fsck on '/dev/mapper/luks-57a92bc2-e0d5-4934-920f-62bf530af600'
/dev/mapper/luks-57a92bc2-e0d5-4934-920f-62bf530af600 contains a file system with errors, check forced.
Inode 14418116 extent tree (at level 1) could be narrower.  IGNORED.
Inode 14948887 extent tree (at level 1) could be shorter.  IGNORED.
/dev/mapper/luks-57a92bc2-e0d5-4934-920f-62bf530af600: Inode 14949823 extent tree (at level 1) could be shorter.  IGNORED.
Inode 14950700 extent tree (at level 1) could be shorter.  IGNORED.
Inode 14977542 extent tree (at level 1) could be shorter.  IGNORED.
Inode 29360556 extent tree (at level 1) could be narrower.  IGNORED.
/dev/mapper/luks-57a92bc2-e0d5-4934-920f-62bf530af600: Inode 29361709 extent tree (at level 1) could be narrower.  IGNORED.
/dev/mapper/luks-57a92bc2-e0d5-4934-920f-62bf530af600: Inodes that were part of a corrupted orphan linked list found.

/dev/mapper/luks-57a92bc2-e0d5-4934-920f-62bf530af600: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)
ERROR: Bailing out. Run 'fsck /dev/mapper/luks-57a92bc2-e0d5-4934-920f-62bf530af600' manually

********** FILESYSTEM CHECK FAILED **********

* Please run fsck manually. After leaving *
* this maintenance shell, the system will  *
* reboot automatically.                    *

********************************************

sh: can't access tty; job control turned off
[rootfs ~]#

Mod edit: Converted screenshot to text via OCR. This way it’s searchable and saves server space. :wink:

It’s telling you exactly what to do on the screenshot you posted.
Presumably your unclean shutdown corrupted the root filesystem.

I assume you just killed it with the power switch. You should never do this unless REISUB fails to give a tidy shutown. I strongly recommend waiting between “S” and “U”, to make sure the filesystems have time to sync.

Unfortunately reisub has to be turned on beforehand to work.

Anyways, if manuall fsck from that shell does not work you will have to boot live usb, unlock the container and run it from there (without mounting).

What you should do is:

run fsck manually

the way to do it is:

  • boot from USB
  • open the encrypted container to get access to the file system within
  • run fsck on that file system

sequence:
lsblk -f
to identify the disk/partition that is encrypted
then decrypt/open it:
sudo cryptsetup open /dev/xyz SomeNameOfYourChoice
(xyz being the partition identified earlier)

sudo fsck.ext4 -v /dev/mapper/SomeNameOfYourChoice

1 Like

If you omit the ext4 from the fsck it will try to detect the filesystem type. You also see it in the lsblk -f output. Just saying in case it is something different.