Fixing Grub Menu

Discussion in 'Linux' started by 3rror, Oct 4, 2018.

  1. 3rror

    3rror MDL Novice

    Oct 3, 2018
    Hi everyone,
    I was using Windows 7 and Ubuntu 16.04 as dual boot system.
    But again I installed android x86 again in Desktop,
    So, Now I am having 3 OS in my PC, but due to the installation of android x86 the boot menu has been changed to Grub Loader and now I cannot open Ubuntu.
    So, is there anyway to remove Android x86 from my PC or adding ubuntu back into Grub menu?

    Sorry for my bad English,
    Any kind of help is appreciated.
  2. John Sutherland

    John Sutherland MDL Addicted

    Oct 15, 2014
    #2 John Sutherland, Oct 4, 2018
    Last edited: Oct 4, 2018
    Hello @3rror - I'm not 100% familiar with Android x86 since I never installed it. I'm going to base my advice on several big assumptions, so you'll have to help me out.

    Assumption #1: I'm going to assume that Android x86 uses Grub 2 as the bootloader, just like Ubuntu does. Please confirm this by telling me if you see the Grub boot menu appear when you boot the machine. "GNU Grub version 2.02" should appear at the very top of the screen.

    Assumption #2: I'm going to assume that all three operating systems are installed on the same hard drive. If you're using two or more drives, stop right here and tell me, do not proceed, because things just got a lot more complicated!

    Assumption #3: I'm going to assume that when you installed Android x86, you did not delete, reformat, or overwrite the existing root partition used by Ubuntu. Please confirm that there are three separate partitions for Windows (NTFS), Ubuntu (ext4), and Android x86 (?not sure what filesystem is used?) on the disk. If Android x86 uses ext4 by default, then there should be two ext4 partitions on the disk, not just one.

    If the answer to all of my assumptions is "Yes", then you can re-install Grub by booting into a live CD session using your Ubuntu installation media and using the following terminal commands:

    1.) sudo fdisk -l (where -l is lowercase L, not numeric 1)
    2.) sudo blkid

    Use the above two commands to determine which partition is used as Ubuntu's root partition. You have to be sure of this before proceeding! In this example, I'll be using /dev/sda3, but you must use whatever applies to your own system! Please be sure and change this accordingly!

    3.) sudo mount /dev/sda3 /mnt ### This mounts Ubuntu's root partition, again, use whatever applies to your own system!
    4.) sudo grub-install --boot-directory=/mnt /dev/sda ### This re-installs Grub

    Now shut down the live CD session and reboot from the hard drive. You should see all three operating systems appear in the Grub boot menu. If not, post back and tell me what is there and what is missing.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. gorski

    gorski MDL Guru

    Oct 21, 2009
    #3 gorski, Oct 24, 2018
    Last edited by a moderator: Oct 24, 2018
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...