Stuck in emergency mode and no NetworkManager

I have been using Fedora 40 Workstation on my laptop since it was released and have been increasingly impressed as pretty much everything I need has eventually worked, including sound, BT, WiFi and incremental improvements with the nvidia drivers and performance is now much better than under Windows for CPU bound stuff (probably IO too, but not measured).
But, I can no longer boot into fedora, getting dropped into “emergency mode” and not able to systemctl restart NetworkManager there, which just asks for the root password again.
The vmlinuz and initramfs the grub menu points at seem to be there, under /boot which is a normal folder under / and I can see nothing wrong (although I know very little, so not sure that means much). /boot/efi is a mountpoint to nvme0n1p1 which is where the original Windows boot stuff is - booting into Windows still works fine, as does booting into other fedora 40s I can install in new partitions on the same disk after this issue started occuring with my real fedora installation, using the same /boot/efi partition.
I tried rpm --reinstall kernel*.rpm (can’t use my usual dnf update ... since there is no network in my emergency mode) after downloading the 6.10.11 kernel rpms from another boot and mkconfig and dracut --force but none of that has worked yet.
I am obviously not qualified to do this stuff and have been trying increasingly wild stuff (I really need to use the machine with my old working setup), including taking the new install of fedora, update everything, and kernel to 6.10.11 and then try to cp -rp on /etc (except fstab), /home, /var, /usr, /opt from the original partition to see if I can make any progress to get any closer to my old setup, but nothing works so far.
If there is no obvious way to fix my original fedora so I can boot into it, is there any way to install a kernel and then use all my old data (as listed above) and thus, apps, settings, bookmarks …? Or, conversely, any way to chroot into my old / from the new fedora installation and somehow do stuff that might get the old boot working again (whatever dumb stuff I have tried has failed)?

thanks @vgaetera !
I did try to reinstall grubs2 before I posted (and I think that may actually be a very promising try as the other fedoras I subsequently install, using the same partition for the /boot/efi mount just work) but I got stuck since it mentions a mount for
/boot which I do not have. I have /dev/nvme0n1p4 mounted at /and /dev/nvme0np1 (which was there on the out-of-the-box laptop, and is also used by the original Windows boot) at /boot/efi.
Also, mount /dev/nvme0n1p4 /mnt -o subvol=root brings up
mount: /mnt: fsconfig system call failed: ext4: Unknown parameter 'subvol'.

So, I had not made much progress with that. Any ideas?

Also, since I have to constantly reboot every time I fail, can I use the working fedora installation on another partition rather than the live CD?

Can I use the Disks app to mount the 2 partitions mentioned above (which I know how to do simple stuff with) instead of the commands in the article (mount with subvol etc which I cannot get top work) or would that lose something essential?

can I use disks? It understands file-systems and their needs better than I do.

The above mount command assumes the default configuration with root and home subvolumes on a BTRFS filesystem. You appear to have an ext4 filesystem on nvme0n1p4. You can use Gnome Disks from the Live USB to see the filesystems for each partition and also mount them to see if there are errors.

1 Like

@gnwiii thanks - I never have had a mount at /boot but the partitions mounted on/ and /boot/efi I have always been able to mount with Disks when running ubuntu of another fed on the same laptop, so I with keep going down that track for reinstalling grub2 and report back.

But step 7 is

  • Mount the /boot partition (e.g. /dev/sda2).

# mount /dev/sda2 /mnt/boot

but, as described a couple of times above, I never have had a mount for /boot, just for /boot/efi. Any ideas?

If your file system is ext4 then you would not normally have a separate /boot partition.
The question was asked about file system types.
Please post the output of sudo fdisk -l and lsblk -f so we can see the full structure of your system.

@computersavvy - thanks for taking a look

$ sudo fdisk -l 
Disk /dev/nvme0n1: 1.86 TiB, 2048408248320 bytes, 4000797360 sectors
Disk model: HFS002TEJ9X101N                         
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 555FB144-1C3E-4D4E-B4E9-5F0CD1106B9B

Device               Start        End    Sectors   Size Type
/dev/nvme0n1p1        2048     534527     532480   260M EFI System
/dev/nvme0n1p2      534528     567295      32768    16M Microsoft reserved
/dev/nvme0n1p3      567296  496697998  496130703 236.6G Microsoft basic data
/dev/nvme0n1p4   496699392  706625535  209926144 100.1G Linux filesystem
/dev/nvme0n1p5  3055409152 3251034111  195624960  93.3G Linux filesystem
/dev/nvme0n1p6   706625536  902250495  195624960  93.3G Linux filesystem
/dev/nvme0n1p7   902250496 1398034431  495783936 236.4G Linux filesystem
/dev/nvme0n1p8  1398034432 3055409151 1657374720 790.3G Linux filesystem
/dev/nvme0n1p10 3251034112 3446345727  195311616  93.1G Linux swap
/dev/nvme0n1p11 3446345728 3944390655  498044928 237.5G Linux filesystem
/dev/nvme0n1p13 3948294144 3949932543    1638400   800M Windows recovery environ
/dev/nvme0n1p14 3949932544 4000264191   50331648    24G Microsoft basic data
/dev/nvme0n1p15 4000264192 4000796671     532480   260M Windows recovery environ

Partition table entries are not in disk order.


Disk /dev/zram0: 8 GiB, 8589934592 bytes, 2097152 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

I now have 2 fedora 40 workstation installations on the disk, both fully updated, including kernel 6.10.11.
Both mount nvme0n1p1 onto /boot/efi.
The one on tempfed (ie nvme0n1p5 mounted on /, that I installed just so I can try to fix my real installation) works fine (but is pretty bare), and this is what I am using instead of a “live CD”, just while I try to fix the problem booting into the other installation.
The installation on fed (ie nvme0n1p6 mounted on /) is the one I can no longer boot into (drops into “emergency mode” with no network as described above) I must somehow fix (or at least rescue all the apps/settings/data/setup from otherwise I would lose a lot).
I have tried a lot of things, including setting selinux=0 by pressing e at the grub menu, clearing out the /boot directory and reinstalling the kernel (and another, older kernel) from chroot in the working (tempfed) installation and reinstalling grub2, also trying some other, probably silly stuff while in the chroot.

The lsblk -f below is from the installation I can boot into (tempfed) but the only difference on the one I can’t boot into (fed) is that b40983cd (nvme0n1p6) is mounted at / (and that is where all my apps/settings etc are that I hope to not have to start from scratch with on a clean fedora install).

$ lsblk -f
NAME FSTYPE FSVER LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
zram0
                                                                                  [SWAP]
nvme0n1
│                                                                                 
├─nvme0n1p1
│    vfat   FAT32 SYSTEM      463B-EED0                             119.6M    53% /boot/efi
├─nvme0n1p2
│                                                                                 
├─nvme0n1p3
│    ntfs         OS          CECCC1CACCC1AD51                                    
├─nvme0n1p4
│    ext4   1.0   fed40repair 213242a3-5e90-42da-b3dd-f6cdae80226a                
├─nvme0n1p5
│    ext4   1.0   tempfed     ca051ff0-0453-4c6e-a8ea-926c6fc9cab4   78.1G     9% /
├─nvme0n1p6
│    ext4   1.0   fed         d0523cc1-e30d-4c58-a753-e444b40983cd                
├─nvme0n1p7
│    ext4   1.0   free1       ca13fdac-984b-4e3f-b855-3abce5a4d116                
├─nvme0n1p8
│    ext4   1.0   free2       2635d03f-754e-4209-a5cc-12fe9758eb08                
├─nvme0n1p10
│    swap   1     swap        7170f4c9-1b6b-42f3-93bb-3cf9fcd09169                [SWAP]
├─nvme0n1p11
│    ext4   1.0   data        c5f258eb-8147-4649-bf8d-94a72153c870                
├─nvme0n1p13
│    ntfs                     0CE2B5A4E2B59306                                    
├─nvme0n1p14
│    ntfs         RESTORE     C8B848D5B848C422                                    
└─nvme0n1p15
     vfat   FAT32 MYASUS      A648-FB3F                     

All ideas very welcome. I think it is something very small that is broken, but I don’t know how to look for it.

PS A final bit of info for now - every few months, I boot into Windows and let it update whatever it wants to. This problem started the next time I tried to boot into my work fedora after a Windows update. But, I have updated Windows hundreds of times without this.
Also, I checked that secure-boot is still disabled.

I have encountered problems booting Fedora after Windows updates. The most common problem is that Windows 11 enables “fastboot”, which is another name for hibernation. In “Settings > System Recovery” Windows 11 has “Advanced startup” which allows you to select a USB drive or disk to boot.

By doing this you have almost certainly hosed the original fedora installation and will likely have difficulty recovering.

Grub by default, during an installation, creates files in /boot/efi/EFI/fedora for the version that is currently being installed and overwrites the files there that pertained to the prior fedora installation. After the second installation you would no longer be able to boot the original fedora installation OS.

The issue is that both installations create a directory /boot/efi/EFI/fedora and place grub boot files there for the first stage of booting. One file that is critical for booting the proper fedora version is /boot/efi/EFI/fedora/grub.cfg which is a pointer to the /boot partition for the installed os to be booted. Since that points by UUID to the proper partition, when it is overwritten it now boots the last installed fedora version only.

You were much safer with using the live media USB and not doing the new install on the same drive.

Now the easiest recovery would be to go back to the live USB, backup your user data that you want to save, then delete all the fedora partitions and start over with a new clean install. (p4, p5, p6, p7, p8, p10, p11). I can only guess at this point that p7, and p8 may have been the original fedora partitions but without more data cannot be certain.

I also note that the 3 windows recovery partitions that normally would be p4, p5, and p6 appear to have been renumbered to p13, p14, and p15 so you possibly may need to do a windows recovery process the next time you boot windows.

@computersavvy - there are lot of really useful observations and info there thank you very much!

I created another topic as that exercise is worthwhile stand-alone, imho, but I have also been playing that grub.cfg file you mentioned, and it seems the UUID there is used to populate the kernel commands in the top grub-menu entry, but there must be more to it than that as just editing the UUID and getting a grub entry pointing to the old partition is not enough to get booted.

One other thing I noticed is that when I run grub2-mkconfig from “emergency mode” it says something like nvme0n1p1 allocation flag deprecated which is not something I’ve encountered in working installations of fedora.

I also tried chrooting as described in the article about reinstalling grub2 and also systemd-nspawn -D /mountpoint-to-old-fed but then grub-probe (called indirectly) complains about not being able to access /dev stuff and I could not find any way to mount -o bind them (also need the right /boot/efi to be mounted otherwise files are just put in the directory rather than the mount target nvme0n1p1), and even if I did, I am not convinced it would work: from chroot or systemd-nspawn I was hoping to be able to reinstall the kernel, reinstall grub2, grubs2-mkcongi, a few dracuts here and there and … that’s pretty much the extent of fancy words I’ve picked up so far, but it is clearly not enough.

… so far, I can still chose which OS I want to try to boot into, so I don’t need to ask Windows for permission to boot from USB, etc. I suppose most people know, but in many cases, hitting some key, ESC in this case, during the early boot (before grub menu) gives a menu of stuff you can boot from, including USB if there is an appropriate device plugged in.

Toggling Windows 11 “fast start” on/off (via control panel) does not change anything so far, but that was a good suggestion, thank you! What solution did you find when you had such issues as you described, or did you just start from scratch every time?

When a Windows update turns on “fast start” I disable it, but it comes back – I think with updates that boot Windows multiple times. Windows 11 also sometimes changes the default boot entry – I want it to go to the grub2 menu.

I’ve seen that effect multiple times too, but it is easy to resolve in BIOS.

Also, FYI albeit getting off topic slightly, I had another Fedora installation that worked fine (including, obviously, boot-up) with Windows “fast start” both on an off (according to its Control Panel UI/checkbox, anyway), so it is probably not directly causing what I described in this topic.

@computersavvy - that seems to be a key observation that I initially paid not enough attention to. Is it possible that the last Windows11 update decided to renumber the partitions somehow? It turns out I had stuff in /etc/fstab which depended on the original partition numbers, and when I fixed/removed them I could boot again into the all important fedora installation I needed! I now have 2 working fedora 40 workstations and Windows, but I removed rawhide and ubuntu with latest mainline kernels. BTW, in case anybody is wondering, I had all those (working-all-on-the-same-machine btw) OSs/distros/versions on the same machine because for the first several months, some critical components of my hardware were not supported by out-of-the-box fedora so I was constantly looking for a Linux setup that works for me, and, it is good-enough by now.

So, I am not sure if the issue was resolved by all the chroot stuff from instructions here (thank you!) and elsewhere or by fixing the mounts. I am reluctant to play around much more, but it does seem that having a bad mounting instruction during boot could instigate emergency mode, and therefore I did not realise that I had already otherwise achieved what I needed.

Anyway, I learnt a lot of stuff that I will probably never need again, and will therefore forget within a couple of weeks, but it is pretty impressive what you are allowed/enabled(/encouraged/obliged(?!)) to do in Linux!

BTW @computersavvy - I noticed your name comes up all over the place helping people be able to use of their Linux machines, especially adding critical points to other people’s answers, which no doubt helped many get back to work (or play, or whatever!) much quicker and also helped people learn and “understand” more and narrow down what to search for.

1 Like

:+1:

I spend a considerable time assisting others. After all, when retired it is important to stay active in other ways.

Yes, having a mount instruction in /etc/fstab that does not work may cause a hang or possibly emergency mode depending upon the exact conditions.