Sudden emergency


I am a Linux beginner but I really enjoyed it so far. So far. Since yesterday, my Linux (pop OS) only wants to boot into emergency mode. I have a suspicion, even though my Linux and Windows are located on different physical disks, somehow Windows does it's toxic ex lover things and somehow broke my Linux I assume. It's there a terminal command to somehow reorganise my boot files?
This entry was edited (15 hours ago)
in reply to Rubanski

@Rubanski If it's booting into emergency mode, there are usually one of three issues, kernel is corrupt, a file system can not be mounted read/write, and this can be because of file system corruption or in the case of mdraid, because a raid device failed to self-assemble, or initramfs is broken. The easy way to fix most of these is to use an automated utility called boot repair, you download the ISO then burn to a thumb drive, then when you run into this kind of problem boot off the thumb drive. I'd start by trying to determine which of these it is, if you get into emergency mode then you at least have a shell prompt, try typing dmesg to see if there are any errors relating to the kernel, then check if all of the partitions are mounted and if they are all mounted read/write. If one or more is mounted read only this usually means that the automatic fsck found errors it can not fix and needs a manual run, in which case try fsck -f -y /dev/sdxx or /dev/nvmexnxpx, which ever the case may be (hard drive verses SSD). If this was the issue after the fsck successfully repairs the file system you should be able to boot successfully. If not, and nothing kernel related shows up in dmesg, then probably your initramfs has gotten hurt. In this case since you are new to Linux, boot repair is the easiest way to fix it. You can also fix manually but that is more complex, however if you need instructions on how to do this let me know and I will elaborate. Even doing so manually though requires another bootable Linux media, does not have to be boot repair, a popos install USB will also do.
Unknown parent

friendica (DFRN) - Link to source

Nanook

@just_another_person @Rubanski On most modern systems neither Windows nor Linux is going to hurt each other's boot record because usually on a dual boot system you're going to launch grub out of the boot block which is going to them find and mount the UEFI partition which is a fat-32 partition usually mounted on /boot/efi by Linux, and then grub is going to continue from a directory within /boot/efi, windows similarly will have a directory there, and grub if it finds both will present a menu at boot. Since both use separate directories on this UEFI System partition, one should not interfere with the other unless the partition is too small and you run out of disk space. I usually size my EFI partition at 512MB and that's always been more than sufficient for multiple operating systems. If you re-install WIndows, it will overwrite the boot block with it's own boot loader, but restoring it with grub will you back to where you were. If you are a real glutton for punishment, you can setup the Windows boot loader to chain load grub, this works as I have actually done it, more as a matter of curiosity than anything else. But I prefer to use Grub as the first boot loader as it's faster and less prone to exploding.
in reply to Rubanski

Do you have any drives/ partitions set up to load at boot other than the main linux partition?

A common issue can be if linux is trying to mount a partition specified in fstab (the config file that lists all the hard drives to be loaded) and it can't mount it, it will go into emergency mode. It does this as it assumes the drives are critically important and to prevent any damage to your system. You can mark non essential partitions as "nofail" in the fstab file so that linux continues to boot even if those partitions are unavailable.

If you'd added a USB drive or another hard drive to auto mount at start up and its not available to linux then that might be the issue. Reinsert those drives and linux should boot. Alternatively you can login using emergency mode and edit the fstab file yourself if you know what youre doing. The offending drive can be removed/commented outthe fstab file or the nofail option added.

If your linux install is set to mount your windows C: partition (for file access in linux for example) then its important to know the drive can be locked out by windows. Windows "fast startup" is a very common cause - it basically means windows doesnt shut down fully, it does a fake shutdown (hibernates), and doing this locks down the drive, preventing any access to the C: drive including in linux. If this scenario applies to you, boot into wndows, disable fast startup in the control panel and then try to reboot into linux.

It this works it is still worth using the "nofail" option in fstab for any non essential drives. I personally dont auto mount my windows drive at all anymore; I have it visible in my file manager but manually mount it (just clikcing on it does it) when I need it.

This entry was edited (7 hours ago)
in reply to Nanook

While I agree with your assertion in theory, I cannot agree that windows doesn't mess with grub. I have had 5 different issues with grub being overwritten, 1 was because windows and Linux were on the same drive, but the other 4 was simply because I launched windows through grub.

My advice for people dual booting is to never launch windows through grub and instead change your boot order in bios, this has made all of my boot related issues go away.

in reply to Attacker94

@Attacker94 The boot block pointing to grub is what gets overwritten, grub itself in /boot/efi doesn't. You can fix either though with either boot repair or boot from a usb thumb drive, mount the partitions on /mnt and subdirectories,mount --bind /dev /mnt/dev, /dev/pts /mnt/dev/pts, and then mount --rbind /proc /mnt/proc and /sys /mnt/sys, cp /etc/resolv.conf to /mnt/etc/resolv.conf, chroot to /mnt, and then grub-install /dev/sda or whatever the drive is. Not a big deal. And this only happens if you install Windows AFTER you have installed Linux.