12.04 - How to make Grub display after installing Ubuntu on a laptop with Windows OS?

  • Lucas

    I just installed Ubuntu 12.04.1 on a laptop, but whenever I turn on my computer, it still boots to Windows and GRUB doesn't seem to be working at all.

    My partition scheme is as follows:

    • /dev/sda1 - Some NTFS partition for Lenovo recovery or something labeled SYSTEM_DRV (this has the Windows boot flag on it)
    • /dev/sda2 - My NTFS Windows partition
    • /dev/sda3 - My extended partition containing:
      • /dev/sda5 - / partition, ext4, 20 GB
      • /dev/sda6 - swap partition, linux-swap, 3 GB
      • /dev/sda7 - /home, ext4, 450 GB
    • /dev/sda4 - Another partition that is useful for Lenovo recovery or something labeled LENOVO_PART.

    The point is, I installed Ubuntu 12.04.1 according to this scheme via the LiveUSB environment, but whenever I turn on my computer, the motherboard BIOS screen is shown, and then it jumps right to Windows and GRUB is skipped completely.

    What can I do to fix this?

  • Answers
  • Huckle
    1. Boot to your live disk
    2. Open gparted
    3. Right click on /dev/sda5
    4. Click 'Manage Flags'
    5. Set the boot flag (same thing as the active flag in windows)

    Grub should now load if it is actually installed on /dev/sda5

  • Related Question

    partitioning - How to remove a second Ubuntu install?
  • moraes

    I installed Windows XP in dual-boot with Ubuntu to play Skyrim and that ended up breaking GRUB. After trying zillions of things to fix it (including using boot-repair), I installed Ubuntu in a new partition, side-by-side with the old Ubuntu and XP. After that GRUB worked again and I can now access my old Ubuntu and XP, but now I have two Ubuntus and I want to drop the new one. How do I do that without breaking GRUB again?

    Here's the result for sudo fdisk -l:

    Device      Boot    Start       End     Blocks      Id  System
    /dev/sda1   *           1       17303   138986316   83  Linux
    /dev/sda2           19799       29359    76798732+   7  HPFS/NTFS
    /dev/sda3           29360       30401     8369865   82  Linux swap / Solaris
    /dev/sda4           17304       19798    20040705    5  Extended
    /dev/sda5           17304       17595     2343936   83  Linux
    /dev/sda6           17595       18811     9764864   83  Linux
    /dev/sda7           18811       19677     6952960   83  Linux
    /dev/sda8           19677       19798      975872   82  Linux swap / Solaris

    sda1 and sda3 are my old Ubuntu, sda2 is Windows XP, and sda4 to sda8 are the new Ubuntu install (I created different partitions for /boot, / and /home, should not have done that just to fix GRUB).

    And /etc/fstab looks like this:

    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    nodev,noexec,nosuid 0       0
    # / was on /dev/sda1 during installation
    UUID=e41d0403-82db-4379-9d3e-b67cb06fc08d /               ext4    errors=remount-ro 0       1
    # swap was on /dev/sda5 during installation
    UUID=5a54507a-82f0-4275-b531-f88b9cfabbcb none            swap    sw              0       0

    And here is the report from Boot-Repair:


    And here is the list from /dev/disk/by-uuid:

    ubuntu@ubuntu:~$ ls -la /dev/disk/by-uuid
    total 0
    drwxr-xr-x 2 root root 140 2011-11-16 13:21 .
    drwxr-xr-x 6 root root 120 2011-11-16 13:19 ..
    lrwxrwxrwx 1 root root  10 2011-11-16 13:19 11F7-4048 -> ../../sdb1
    lrwxrwxrwx 1 root root  10 2011-11-16 13:19 40b84b5c-dd62-4267-a41c-e5afc0c178a4 -> ../../sda3
    lrwxrwxrwx 1 root root  11 2011-11-16 13:19 82672ddd-82ac-4d41-98c2-fc359f248f3b -> ../../loop1
    lrwxrwxrwx 1 root root  10 2011-11-16 13:21 DE34ED7A34ED5655 -> ../../sda2
    lrwxrwxrwx 1 root root  10 2011-11-16 13:21 e41d0403-82db-4379-9d3e-b67cb06fc08d -> ../../sda1

  • Related Answers
  • binW

    Boot in to Ubuntu installation that you want to keep. Delete the partitions for the other Ubuntu install and run update-grub.
    So if you want to keep your old linux installation and get rid of the one you installed later, just boot into your old linux installation and start gparted or disk-utility (which ever you like). From there delete sda4, sda5, sda6, sda7 and sda8 i.e all the partitions you created for new installation of Ubuntu. Now open terminal and run sudo update-grub. This will update the grub and remove the other Ubuntu install from the grub startup screen.

  • Michael K

    You can perform the following steps:

    1. comment out the lines for sda1 and sda3 in your /etc/fstab. this prevents them from being mounted.

    2. reformat (and maybe even repartition) the two partitions. However, merging them will most likely only work, if they are stored physically behind each other on the disk.

    3. invoke update-grub to make grub refresh its menu.

    But be careful, your computer seems to boot from sda1. Depending on how you installed the second ubuntu, you might have to mark the new root / boot partition as bootable.