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?

  • BananaTrifleViolin@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    ·
    edit-2
    7 hours ago

    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.

  • just_another_person@lemmy.world
    link
    fedilink
    arrow-up
    15
    arrow-down
    1
    ·
    14 hours ago

    The only interaction Windows would have with a Linux partition is fudging the boot record. If it’s booting to emergency mode, you likely got a bad update. It should give you the option to boot to a previous working kernel if you hold down the shift or an arrow key while booting to grub. Just pick a previous known good version and start repair from there.

    • nanook@friendica.eskimo.com
      link
      fedilink
      arrow-up
      2
      arrow-down
      2
      ·
      14 hours ago

      @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.

      • Attacker94@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        9 hours ago

        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.

        • nanook@friendica.eskimo.com
          link
          fedilink
          arrow-up
          2
          arrow-down
          1
          ·
          9 hours ago

          @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.

          • Attacker94@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            6 hours ago

            Thank you, I was aware of this, but I believe you are mistaken in your last sentence because Linux has always been the second one to be installed for me and the issue still crops up when I forget to heed my own advice

  • nanook@friendica.eskimo.com
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    10 hours ago

    @Rubanski if you have mdraid partitions, you also should add bootdegraded=true to the grub command line so the system will still boot even if a disk fails and an array is in the degraded mode.

  • nanook@friendica.eskimo.com
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    14 hours ago

    @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.

  • catloaf@lemm.ee
    link
    fedilink
    English
    arrow-up
    4
    ·
    14 hours ago

    It probably gives some useful info. What does it say? Also, what changed between now and the last time it worked?

  • Damage@feddit.it
    link
    fedilink
    arrow-up
    1
    ·
    11 hours ago

    Windows can’t read your linux partitions, it doesn’t support them, so it’s almost impossible for it to damage your installation. It used to be that it could mess with the bootloader, but since UEFI got implemented, that’ become less likely.
    What does it do when you boot into normal mode? Does it get to the login screen or not? Do you see error messages?

    If you get to login but no further, it could be a problem with your user, like a bad shell setting, since rescue mode logs you in as root usually (I’m not very familiar with debian/ubuntu based distros), otherwise it could be you installed/updated/removed the wrong package(s), unfortunately as far as I’m aware apt doesn’t have history rollback capabilities, so undoing that is going to be difficult.

    This is an unpopular opinion, but when you’re still inexperienced with linux, the quickest way to fix your system is just reinstalling. Back up your whole home dir beforehand and you’ll just have to drop it back in place to get all your data and settings back. If you have more than one user you may want to be careful with the UID, you may have to chown -R the whole directory.

  • haui@lemmy.giftedmc.com
    link
    fedilink
    arrow-up
    2
    arrow-down
    5
    ·
    13 hours ago

    Bummer. Pop os is as bulletproof as any non immutable operating system i can imagine. I have booted into pop many times without experiencing this once and same goes for others i know.

    Most likely, it really is windows messing with your stuff or the ssd is on its way out. Only time I did experience similar things was when the ssd was becoming unreliable.

    I did recently hear of hybernation being a problem when dual booting when someone booted into windows in between while linux was hybernating.

    I’d suggest booting a boot stick with a live stick and try from there. Since pop os is made by a company selling hardware, they have a pretty strong motivation to make their distro work. Check their website too https://support.system76.com/articles/bootloader/

    Let me know if you need more help.