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

Thread: UEFI boot loader entry disappears when cold booting, ASRock motherboard

  1. #1
    Join Date
    Feb 2014
    Beans
    16

    Question UEFI boot loader entry disappears when cold booting, ASRock motherboard

    In the beginning, I just had one HDD and it was running Ubuntu. Then I bought an SSD, and installed Ubuntu on that, repurposing the HDD to be a secondary data drive. But I never wiped the HDD. Now I'm in a situation where the system SSD drive has the EFI partition, but the secondary HDD is the only one with a bootloader in its MBR. I don't know how this happened (didn't realise it was possible tbh). But it means that apparently my SSD is completely reliant on the HDD to be present in order for booting up to work.

    This is what boot-repair reports:
    Code:
    ============================= Boot Info Summary: ===============================
    
     => Grub2 (v1.99-2.00) is installed in the MBR of /dev/sda and looks at sector 
        2048 of the same hard drive for core.img, but core.img can not be found at 
        this location.
     => No boot loader is installed in the MBR of /dev/sdb.
    
    sda2: __________________________________________________________________________
    
        File system:       ext4
        Boot sector type:  -
        Boot sector info: 
        Operating System:  
        Boot files:        
    
    sdb1: __________________________________________________________________________
    
        File system:       vfat
        Boot sector type:  FAT32
        Boot sector info:  No errors found in the Boot Parameter Block.
        Operating System:  
        Boot files:        /EFI/ubuntu/grub.cfg /EFI/Boot/bootx64.efi 
                           /EFI/ubuntu/fwupx64.efi /EFI/ubuntu/grubx64.efi 
                           /EFI/ubuntu/mmx64.efi /EFI/ubuntu/shimx64.efi
    
    sdb2: __________________________________________________________________________
    
        File system:       ext4
        Boot sector type:  -
        Boot sector info: 
        Operating System:  Ubuntu 16.04.5 LTS
        Boot files:        /boot/grub/grub.cfg /etc/fstab
    
    sdb3: __________________________________________________________________________
    
        File system:       swap
        Boot sector type:  -
        Boot sector info:
    /dev/sda = secondary data HDD
    /dev/sdb = primary system SSD

    What I want is to somehow install a GRUB bootloader into the MBR of the SSD, so that it can be self-reliant and my computer can still boot up if the secondary HDD were removed.

    Is it possible to do this? Preferably without having to wipe and reformat the SSD?

    Thanks for any help!
    Last edited by Jugdish; May 21st, 2019 at 01:55 AM.

  2. #2
    Join Date
    Dec 2009
    Location
    Fareham, UK
    Beans
    2,356
    Distro
    Ubuntu

    Re: How to install GRUB into MBR without wiping existing partitions?

    Hi Jugdish
    You have posted incomplete info, could you post the complete report or the link to it, then we can come with the correct suggestions to help you.

  3. #3
    Join Date
    Jun 2014
    Beans
    6,272

    Re: How to install GRUB into MBR without wiping existing partitions?

    An EFI install does not need nor should it have any boot code in the MBR. Have you set the SSD to first boot priority in the BIOS? What is the result? And also, please post the entire output of boot repair.i

  4. #4
    Join Date
    Feb 2014
    Beans
    16

    Re: How to install GRUB into MBR without wiping existing partitions?

    Sorry about that, here is the complete report! http://paste.ubuntu.com/p/sgM3hHgm7Z/

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

    Re: How to install GRUB into MBR without wiping existing partitions?

    Have you set the SSD (sdb drive) to first boot priority in the BIOS?
    If you have the large drivee (sda) set to boot, I would not expect it to boot anything as you have Grub code in the MBR of that drive but the core.img file and other Grub files needed to boot are gone as you have apparently formatted that partition. In any case, no files show.

  6. #6
    Join Date
    Feb 2014
    Beans
    16

    Re: How to install GRUB into MBR without wiping existing partitions?

    Ok, I've done a bit of experimenting. I tried booting up with only the SSD attached, moved it to SATA slot 1, ensured it was boot priority #1 if UEFI setup, and all that.
    https://imgur.com/5EbMRm9
    https://imgur.com/ldYrzPy

    It seems that this drive simply cannot boot up on its own. I get this error on the screen:
    Code:
    Reboot and Select proper Boot device
    or Insert Boot Media in selected Boot device and press a key
    https://imgur.com/gQhncM8

    Then, I re-attached the large HDD drive, on SATA slot 2, still kept the SSD as boot priority #1. This time, the screen was stuck at a black screen with a flashing cursor and no error message.

    Here's what I've noticed -- if I boot with a boot-repair USB drive and run the default boot-repair option, I can then restart and get back into my system like normal. This will continue to work as long as I am restarting each time. But as soon as I actually shut down the computer completely, when I turn it back on I am stuck in the situation described above, and have to run the default boot-repair option to bail myself out again.

    How have I gotten into this situation and what can be done to fix it??
    Last edited by Jugdish; January 21st, 2019 at 07:31 PM.

  7. #7
    Join Date
    Dec 2009
    Location
    Fareham, UK
    Beans
    2,356
    Distro
    Ubuntu

    Re: How to install GRUB into MBR without wiping existing partitions?

    This is probably the cause of your issue
    Code:
    sdb1: File system:       vfat
    The EFI partition must be formatted as fat32.

    Give this a try.
    Leaving only the SSD connected boot using your install media.
    Start Gparted unmount all partitions, select your current efi partition and reformat to 'fat32'. Apply the changes. Then 'manage Flags' set these to 'boot,esp,hidden' again apply the changes. Exit Gparted.
    Open a terminal and run these one at a time
    Code:
    sudo add-apt-repository ppa:yannubuntu/boot-repair
    sudo apt-get update
    sudo apt-get install -y boot-repair && boot-repair
    When the window opens click 'Advanced' check each tab to possibly purge Grub and reinstall to the correct partition and boot the correct OS. Follow the prompts as they appear, only clicking 'continue' after running the terminal (not sure if there is two or three short terminal sessions).
    Make a note of the generated link so you can post it here if there is any issues.
    Shutdown. Reconnect the other hard drive.
    Start the computer.

    You should now be booting properly.

  8. #8
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How to install GRUB into MBR without wiping existing partitions?

    It says it is FAT32. The Linux driver is vfat.

    Code:
        File system:       vfat
        Boot sector type:  FAT32
    What brand/model system.
    Some systems do not like to boot ubuntu UEFI entry. (HP for one).
    If UEFI updated, some users have reported changing boot order in UEFI works, where efibootmgr boot order setting does not stick.
    The reinstall of grub uses efibootmgr to both add entry & change boot order to make Ubuntu first.


    UEFI normally loses UEFI settings when a drive is unplugged. They seem to auto find Windows, but not Linux installs.
    You then often have to use efibootmgr to update UEFI entry or reinstall grub.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  9. #9
    Join Date
    Feb 2014
    Beans
    16

    Re: How to install GRUB into MBR without wiping existing partitions?

    It's an AMD system, the motherboard is an ASRock FM2A85X-ITX.

    I'm not clear on what steps I should take, if the problem is the way the UEFI boot entries are formatted on disk, or with the motherboard & UEFI boot sequence itself. Reformatting the EFI partition makes me nervous (and is potentially unnecessary, according to oldfred). What else should I try?

  10. #10
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How to install GRUB into MBR without wiping existing partitions?

    Reformatting the ESP (FAT32) is a last resort fix to some issues. Often just a dosfsck works, if issues with the ESP.
    But Boot-Repair did not show any issues.

    Your Boot-Repair report originally did not show any ubuntu entry in UEFI. But after update, your UEFI now shows an ubuntu entry.
    Not sure with Asrock, but have you tried the UEFI boot entry for ubuntu? Often f12 or what ever key you originally used to boot USB flash drive to get UEFI boot menu.

    Have you checked that UEFI is latest version from Asrock? That often fixes many issues.
    Most motherboard vendors will not say they support Linux, but often work better than some brand name systems.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

Page 1 of 2 12 LastLast

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
  •