Results 1 to 9 of 9

Thread: Dual Boot - Grub-install failed

  1. #1
    Join Date
    Oct 2022
    Beans
    4

    Post Dual Boot - Grub-install failed

    Hey guys,

    Tried out multiple stack-overflow ideas. Nothing works.

    Paste-bin link -> https://paste.ubuntu.com/p/H2N6tBzfPJ/

    Windows is already installed. After Windows trying to install Ubuntu. Ubuntu installation fails on grub-install.
    Windows installed in UEFI and the paste-bin was generated by using a live USB and running grub-repair analysis.

    Any ideas/solutions please?

  2. #2
    Join Date
    May 2008
    Beans
    4,091
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: Dual Boot - Grub-install failed

    You have Windows in UEFI and Ubuntu in Legacy mode. Both systems have to be installed in UEFI mode.
    https://help.ubuntu.com/community/UEFI

    Line 57 -60 Bios boot partition created because Ubuntu installer was booted in Legacy mode.
    Line 295 – 297 Boot-repair live session also in Legacy mode.

    Make sure that you have complete data backups.
    Boot Ubuntu installer in UEFI mode.
    Double check that you have booted in UEFI mode via terminal
    Code:
    [ -d /sys/firmware/efi ] && echo "UEFI" || echo "Legacy"
    Open Gparted and delete sda5 and sda6.
    Commence installer and allow it to find newly available free space and continue the installation.

    Line 85 - Is it really Windows 7, which is now unsupported?
    Last edited by tea for one; October 4th, 2022 at 09:34 AM. Reason: Added question about Windows 7

  3. #3
    Join Date
    Oct 2022
    Beans
    4

    Re: Dual Boot - Grub-install failed

    Nah, its Windows 11. Not sure why it says Windows 7 on line 85.

    Tried the above steps, worked like a charm until, got the Grub-install failed on /dev/sda error

    Ran the boot-repair and here's the new pastebin: https://paste.ubuntu.com/p/rrqcVfjfmH/

    Appreciate any help

  4. #4
    Join Date
    May 2008
    Beans
    4,091
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: Dual Boot - Grub-install failed

    Line 284 - /target detected. Please close the Ubuntu installer, then retry.
    Did you try the default repair from the boot-repair session?

    Also, have a look in the UEFI Settings to see if you have other Security switches i.e.
    Disable TPM (Trusted Platform Module) or PTT (Platform Trust Technology) or FTPM (Firmware Trusted Platform Module)
    Disable Device Guard (some Lenovo devices)
    Disable OS Optimised Defaults (some Lenovo devices)

  5. #5
    Join Date
    Oct 2022
    Beans
    4

    Re: Dual Boot - Grub-install failed

    Looked at the UEFI settings, all looks good there.
    Tried the default repair -> https://paste.ubuntu.com/p/h2QtcmrtSM/

    Still doesn't work
    Also, have tried previously erasing the disk and installing only Ubuntu it still throws the 'grub-install failed on /dev/sda'

  6. #6
    Join Date
    May 2008
    Beans
    4,091
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: Dual Boot - Grub-install failed

    Quote Originally Posted by nikhil091 View Post
    Still doesn't work
    Also, have tried previously erasing the disk and installing only Ubuntu it still throws the 'grub-install failed on /dev/sda'
    That's somewhat disappointing, even after erasing the disk and installing.

    Did you notice line 58 - grub-install: warning: You will have to complete the GRUB setup manually.
    These commands in a live session may provide the answer (run each command separately):-

    Code:
    sudo mount /dev/sdXY /mnt
    sudo mount /dev/sdXX /mnt/boot/efi
    for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
    sudo chroot /mnt
    grub-install /dev/sdX 
    update-grub
    Note : sdX = disk | sdXX = efi partition | sdXY = system partition
    sda = disk
    sda1 = efi partition
    sda5 = Ubuntu system partition

    Fingers, arms, toes and legs crossed..............

  7. #7
    Join Date
    Oct 2022
    Beans
    4

    Re: Dual Boot - Grub-install failed

    it failed again.. :/

    attaching a screenshot of my terminal -> https://imgur.com/a/I9qPwGs

    Noticed Errors:
    Warning: EFI variables not set on this system

    Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting

    Last edited by nikhil091; October 4th, 2022 at 11:46 PM.

  8. #8
    Join Date
    May 2008
    Beans
    4,091
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: Dual Boot - Grub-install failed

    Another setback but let's see if this helps.
    Similar commands with one change (third command) highlighted in blue.
    Again, run each command separately (using a live session).
    Code:
    sudo mount /dev/sdXY /mnt
    sudo mount /dev/sdXX /mnt/boot/efi
    for i in /dev /dev/pts /proc /sys /sys/firmware/efi/efivars /run; do sudo mount -B $i /mnt$i; done
    sudo chroot /mnt
    grub-install /dev/sdX 
    update-grub
    Note : sdX = disk | sdXX = efi partition | sdXY = system partition
    sda = disk
    sda1 = efi partition
    sda5 = Ubuntu system partition

    If this does not yield a positive outcome, then a thorough internet search may prove fruitful.
    Many search results appear for EFI variables not set on this system, but I cannot recommend a certain site as I cannot reproduce the problem on my PC.
    Last edited by tea for one; October 5th, 2022 at 10:34 AM. Reason: Reminder - live session

  9. #9
    Join Date
    Oct 2018
    Beans
    180

    Re: Dual Boot - Grub-install failed

    @nikhil091, I use a Lenovo laptop. I fought with it for aprox. 18 months to get linux distro installed. I'll explain how I have to do it.

    First, find out for sure which installer it uses, ubiquity or calamares. If ubiquity, launch installerr from terminal with
    Code:
    ubiquity -b
    This will install system files WITHOUT a bootloadeder. Since you are dual booting with windows, the EFI partition exists.

    If installer is calamares, in app menu, select install file system. This also installs without boot loader.

    When the install is complete, DO NOT RESTART THE COMPUTER YET!!

    Go to https://help.ubuntu.com/community/Boot-Repair and install and run boot repair. Choose purge and reinstall grub. This will give you the boot loader.

    After that, you should be able to restart the computer and be greeted by the grub menu, choose you ubuntu, and begin to enjoy the linux way. In my case, I would get errors about grub shim-signed, and I have to purge and reinstall grub from terminal, no need for live usb and chroot.

    Good luck, I hope this helps.

    Note:: addditional linux installs do not need the boot repair portion, if your going to multi boot. Just install without bootloader, restart into existing distro, update grub, then reboot to new install.
    I'm a firm believer that the only stupid question is the one you don't ask.
    Lenovo ideapad320-15iap, 1.1G Intel processor with onboard graphics, x64, 1TB SSD, 8GB ram
    lubuntu 22.04.1, fully updated

Tags for this Thread

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
  •