Announcement

Collapse
No announcement yet.

boot-repair leaves GRUB without menu

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [GRUB] boot-repair leaves GRUB without menu

    After a recent update, my computer would only boot into some sort of blue-screen test mode; by running "boot-repair", however, I was able to get my computer to boot into GRUB. Unfortunately, though, no menu items are provided for booting -- I am only given "GRUB >" prompt. If I try to fix the boot partition by using the command line, the blue-screen test mode returns.

    I am at a loss as to what needs to be done to fix this.

    When I used boot-repair, the following paste was generated.

    "https://paste.ubuntu.com/p/vYW2cC8Cr4/"

    I have recently re-installed Kubuntu to upgrade it to 20.04, so I haven't yet ruled out the possibility I might just have to install it again; however, I don't particularly want to do that if I can avoid it (in part because I want to avoid the hassle, and in part because I'm not confident that this error will stay away if I run annother update.)

    #2
    Most of the time when one gets a black screen attempting to log into their account it is because the ownership of the hidden file .Xauthority has been given to root. Booting a LiveUSB and then using chown to change it to your account name is all that is needed.

    IF a blank screen is presented right after the POST, when grub is executed, a boot-repair usually fixes it.

    If it doesn't then the easiest, quickest and best way to recover is to spend a hour or so re-install using a checksummed ISO burned onto a USB and then checking the LiveUSB as well. Or, you could spend several hours or days trying to recover.

    To avoid this problem in the future it is best to do regular backups and archiving.
    IF you were using BTRFS, for example, you could boot to a LiveUSB, open a terminal, sudo to root, mount your sda and then do a rollback and reboot, which would take all of 5 minutes.
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      Honestly, if you have nothing invested in your install. It will be easier to re-install.

      However, if you want to learn how to recover from this to add to your knowledge...

      ...basically you can boot from the grub prompt.

      At the prompt type "ls" to list your drive and partitions, it will look something like:

      (hd0) (hd0,msdos1) (hd0,msdos2) (hd0,msdos3)

      There will be more if you have more than one drive or more partitions. Next, you have to know which partition your kernel is on, aka where the /boot folder resides. Lets assume the 1st partition, so now you set the "root" partition with:

      set root=(hd0,1)

      Now you need to set the kernel and initramfs with these commands:

      linux /boot/vmlinuz-5.4.0-42-generic root=/dev/sda1
      initrd /boot/initrd.img-5.4.0-42-generic

      Note a couple things here, the "linux" line also has "root=" to point to the root partition. If your /boot is on it's own partition, this might need to be different - I'm honestly not sure.
      Also note you don't have to know which exact kernel you're using because the GRUB shell will autocomplete the entry for you. So type:

      linux /boot/vmli

      and then hit the "Tab" key and it should fill in. Same for the second line, just type

      initrd /boot/init

      followed by Tab and you should be good. Then just type:

      boot

      and it should begin the boot sequence. If you have the wrong partition, the Tabs above won't work like I said. However, worst case scenario if you do something wrong, you get a KERNEL PANIC and have to start over, but no damage will be done.

      I'm also not sure about this, but I think once you set the root partition, you should be able to do "ls /boot" and see your kernels.

      Assuming you get up and running, you will need to run "sudo update-grub" and "sudo grub-install" before attempting reboot.

      Please Read Me

      Comment


        #4
        Thank you for your help!

        I tried to follow the boot sequence, but when I got to the part where I was supposed to set the kernel, I discovered that the kernel files were missing. At that point, I decided that retreat was the better part of valor, and I re-installed the system. It's working now!

        I had to think about what may have caused the disappearance of the files, and I think it was because after I attempted to compile a project from source, I decided to try to roll back the packages I installed for the compilation process. I thought I was being careful to remove only things that didn't have dependencies, but it seems that somehow, in the process, I nonetheless removed something that took the kernel with it.

        Comment


          #5
          Yeah, rather hard to boot without a kernel! I'd like to say I've never done anything like that, but that would be a total lie.

          Regardless, welcome to the forum.

          Please Read Me

          Comment

          Working...
          X