At the end of the day yesterday the OS was working good, but after turning the computer today Fedora goes into emergency mode:
You are in emergency mode. After logging in, type “journalctl -xb” to view system logs, “systemctl reboot” to reboot, “systemctl default” or “exit” to boot into default mode.
I can’t even access the console to type the commands it suggests - “can’t access console because the root account is locked” and tells me to read sulogin(8). It displays the same message no matter what kernel version I choose at boot + the emergency option.
Using a live usb drive I can see all my files in the home directory.
Can someone please help to get this fixed?
Hi, please first try to go to your BIOS then disable “secure boot”. If after disabling “secure boot” you’re successfully booting to your Fedora Linux, it’s big chances that you was installing packages that alter the kernel, for example graphic driver.
Or if you’re using PC and in the past you already disabled the “secure boot” but it’s always reset to enabled again, may be your bios battery are depleted.
I just tried disabling secure boot, but unfortunately the problem didn’t disappear.
After search on internet, maybe it caused by
fstab failed to mount some partitions. You could mount your partition from live usb and check your current
So it turned out the problem was in some entries in the fstab file (which I didn’t think would cause this because I’ve had them in another computer without any problems), specifically tmpfs for tmp and spool in /var. After removing them problem dissapeared.
Thank you very much for the help!
You said those fstab entries were from another computer.
In Fedora /tmp is automatically configured and mounted as tmpfs without an fstab entry.
I don’t understand the part about /var, but unless you have specifically created a partition for /var and the content is matching what the system expects there then that presents a problem as well. Also, Fedora 35 by default uses btrfs file system and that can be an issue during boot as well for some configs if /var is different.
Many thanks, I wasn’t aware of these things!
To clarify, the below are the exact entries I added in fstab (everything else is as default), on the other computer I mentioned that had them they were added on Fedora 34 (the latest version at the time) and later upgraded to Fedora 35 and never had such issues.
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/spool tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/tmp tmpfs defaults,noatime,mode-1777 0 0
The default in F34 and F35 is for all the standard directories that contain temp files or system configs (/proc, /sys, /run, /tmp, /dev, among others) to be in tmpfs and the system automatically creates them, populates them, and mounts them at boot. I would guess that the timing of the creation and the mounting from fstab was causing a conflict. Possibly the fstab entry blocked access to the system created and already populated entries.
/var/spool is an actual directory on my system and shows this.
# ls /var/spool/
abrt abrt-upload cups lpd mail plymouth
so the tmpfs mount could be hiding the necessary directories under there as well.