Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Grub commandline sometimes when booting

  1. #1
    Join Date
    Jan 2020
    Beans
    8

    Grub commandline sometimes when booting

    I just install Ubuntu 19.10 dualboot with Windows 10. I have Windows 10 on a SSD and Ubuntu on a HDD. When installing Ubuntu I choose boot alongside Windows and it auto installed to the empty space on the HDD. When restarting I sometimes get the grub command line. If I type exit at the commandline it will go to the grub boot menu. I can't pinpoint whats causing this as it doesn't happen all the time. Sometimes the grub boot menu shows up just fine. Anyway to stop the commandline from showing up or figure out what's causing it?

  2. #2
    Join Date
    Jun 2014
    Beans
    5,575

    Re: Grub commandline sometimes when booting

    More details can be obtained on your specific situation by going to the site below, download boot repair using the 2nd option explained on that page, running boot repair as instructed using the option to Create BootInfo Summary and posting the link you get when it finishes here. Do NOT make any repairs.

    https://help.ubuntu.com/community/Boot-Repair

  3. #3
    Join Date
    Jan 2020
    Beans
    8

    Re: Grub commandline sometimes when booting

    Quote Originally Posted by yancek View Post
    More details can be obtained on your specific situation by going to the site below, download boot repair using the 2nd option explained on that page, running boot repair as instructed using the option to Create BootInfo Summary and posting the link you get when it finishes here. Do NOT make any repairs.

    https://help.ubuntu.com/community/Boot-Repair
    Here's the pastebin from Boot-Repair: https://paste.ubuntu.com/p/M54kbYyXfh/

  4. #4
    Join Date
    Jun 2014
    Beans
    5,575

    Re: Grub commandline sometimes when booting

    You have windows boot code in the MBR of the 1TB drive which is unusual as it is a GPT drive and windows won't boot GPT unless it is an EFI install. An EFI install doesn't put anything in the MBR. Is that an upgrade or former install of windows 7 or earlier? Do you just use that for data for windows now,? You do have an EFI partition for windows on the SSD you have EFI partitions on both the SSD with windows as well as on the 1TB where you have Ubuntu. It appears (see line 581 in boot repair) that Ubuntu installed the EFI files on the first partition of the SSD. You could mount that partition to verify it, see if there is an ubuntu folder there with files in it and also mount sda3 (EFI partition on the 1T) to see if there are any Ubuntu files in and ubuntu folder there. Having 2 EFI partitions might be the problem but I'm not sure about that.

    You don't have an entry for windows in the Ubuntu Grub menu which would mean you need to access the BIOS to switch between windows and Ubuntu. Is that the way you want it?

  5. #5
    Join Date
    Jan 2020
    Beans
    8

    Re: Grub commandline sometimes when booting

    Quote Originally Posted by yancek View Post
    You have windows boot code in the MBR of the 1TB drive which is unusual as it is a GPT drive and windows won't boot GPT unless it is an EFI install. An EFI install doesn't put anything in the MBR. Is that an upgrade or former install of windows 7 or earlier? Do you just use that for data for windows now,? You do have an EFI partition for windows on the SSD you have EFI partitions on both the SSD with windows as well as on the 1TB where you have Ubuntu. It appears (see line 581 in boot repair) that Ubuntu installed the EFI files on the first partition of the SSD. You could mount that partition to verify it, see if there is an ubuntu folder there with files in it and also mount sda3 (EFI partition on the 1T) to see if there are any Ubuntu files in and ubuntu folder there. Having 2 EFI partitions might be the problem but I'm not sure about that.

    You don't have an entry for windows in the Ubuntu Grub menu which would mean you need to access the BIOS to switch between windows and Ubuntu. Is that the way you want it?
    The 1TB HDD was recently installed for Ubuntu and Windows (500MB each). I previously installed Ubuntu on the HDD and used Boot-Repair to try and fix it but it added a bunch of unwanted boot entries so I deleted the entire disk and started over. I used Windows disk manager and diskpart to delete the efi and ubuntu partition. I then deleted ubuntu and boot repair from the efi of the SSD. I thought I removed all traces from ubuntu before reinstalling. Did the MBR survive? Before figuring out how to remove ubuntu from windows boot menu I used fixmbr from my recovery partition but it failed.

    Ubuntu created the EFI partition of the HDD when installing (called it ESP) so I thought it was needed. Should I delete this partition since all the boot info is on the efi of the SSD? When I type exit at the grub commandline the grub boot menu does have ubuntu and windows and they both launch fine.
    Last edited by cornaljoe; 2 Weeks Ago at 04:34 AM.

  6. #6
    Join Date
    Jun 2014
    Beans
    5,575

    Re: Grub commandline sometimes when booting

    If you create a mount point for sda3 and mount it and do not see an ubuntu directory with efi files for ubuntu, then it isn't used. The info in boot repair seems to indicate that ubuntu used partition 1 on the SSD as the efi partition and that should be where the ubuntu efi files are ( /dev/nvme0n1p1). If that's the case, then the sda3 partition isn't necessary so verify this first. I don't know if this will resolve your problem. never seen that before. I see you have an entry for windows efi in grub.cfg which I missed earlier as it is not in the standard location.

  7. #7
    Join Date
    Jan 2020
    Beans
    8

    Re: Grub commandline sometimes when booting

    Quote Originally Posted by yancek View Post
    If you create a mount point for sda3 and mount it and do not see an ubuntu directory with efi files for ubuntu, then it isn't used. The info in boot repair seems to indicate that ubuntu used partition 1 on the SSD as the efi partition and that should be where the ubuntu efi files are ( /dev/nvme0n1p1). If that's the case, then the sda3 partition isn't necessary so verify this first. I don't know if this will resolve your problem. never seen that before. I see you have an entry for windows efi in grub.cfg which I missed earlier as it is not in the standard location.
    The efi on the HDD was empty so I deleted it and everything is still the same. Guess I'll try boot-repair again. I think I know how to clean up the mess it makes of the boot menu now so I won't have to reinstall if it doesn't work. Anyway to get the log of boot to see if an error shows up when commandline is loaded instead of the grub menu?

  8. #8
    Join Date
    Jun 2014
    Beans
    5,575

    Re: Grub commandline sometimes when booting

    Have you run sudo update-grub since your menuentries do not show in grub.cfg but only in the /etc/grub.d files

  9. #9
    Join Date
    Jan 2020
    Beans
    8

    Re: Grub commandline sometimes when booting

    Quote Originally Posted by yancek View Post
    Have you run sudo update-grub since your menuentries do not show in grub.cfg but only in the /etc/grub.d files
    Yeah I tried that and it didn't work either. I think I found a solution it says to install grub on the HDD instead of the SSD to keep Ubuntu and Windows separate. Then boot from the HDD and add windows to grub through sudo update-grub. It seems this problem happens when you have grub on one drive and ubuntu on another.

    Is there a way for me to do this without a reinstall? I really don't want to go through all that again.

  10. #10
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Grub commandline sometimes when booting

    One tip I picked up from reading many threads is to shut down, go into the internals of the PC (make sure that power is unplugged), and unplug power to the internal drive (containing Windows). Then get your external Ubuntu working by using One Time Boot Option (F12 typically).

    Other than that, explore efibootmgr options.

    I used the efibootmgr commandline in OldFred post #5 here.

    Study the options from efibootmgr --help

    I have two external devices (HDD and SSD) and the SSD stubbornly refuses to be seen (at times). I am still tracking the cause.
    I have an efi partition on each external device.
    I am now thinking that writing an automation script might automate my workflow.

    [Added link] efibootmgr usage
    Last edited by dragonfly41; 2 Weeks Ago at 11:51 AM. Reason: added link to efibootmgr usage

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •