Friday, January 25, 2013

How to Fix Multi-boot, Fedora Gone after Install Ubuntu

Updated 30 Jan 2013 11.25pm:
A much more user-friendly method with GUI. Click here to see how.


I was installing multi boot environment on my laptop, it will be consist of:
  1. Windows 7 Pro
  2. Fedora 18
  3. Ubuntu 12.10
Fedora & Ubuntu both use Grub2 to multi boot, installing Fedora after Windows work fine, but once Ubuntu was installed only Windows 7 can be seen from the list, Fedora was gone. How do we fix that inside Ubuntu?

There are various fix on internet which can be concluded below:
  1. update-grub: you might have to install grub first before you able to run this command
  2. grub-customizer: this is very handy GUI to manipulate the Grub. It supports Grub2 and it is real intuitive to add new OS onto the Grub menu list.
  3. manual configuration by typing entries: intermediate/advanced user might appreciate this but definitely not for novice user. There are too many things to learn before one can eventually get it run correctly.
The first two methods are the most straightforward method, but it might not work as expected sometimes. My version of getting this solve is pretty simple, despite it required to work with method no. 3.

* To edit grub.conf user is required to open Nautilus with sudo privilege. Make sure you have run sudo nautilus & in terminal to be able to open and edit the configuration file in text editor.
  1. First thing you have to know where the Grub configuration file is stored. It is located under /boot/grub/grub.conf. Open it with a text editor.
  2. Then you have to know where is your Fedora /boot located. We don't need terminal as we love GUI. Go to Dash Home > Disks.
  3. If you follow Fedora installation guide you can easily identify the /boot, which is 25x MB in size. There are two in my Disks Manager, but the already mounted one is for Ubuntu. So the other one is Fedora for sure.

  4. Mount the Fedora /boot by select the partition and press the play button. 
  5. Open the /boot/grub2/grub.conf with text editor.
  6.  Locate the following and COPY the whole content except for the ###BEGIN....### & ### END....###:
  7.  ### BEGIN /etc/grub.d/10_linux ###  
     menuentry 'Fedora' --class fedora --class gnu-linux --class gnu --class os
    . 
    .
    . *this dots mean there are a lot of content in the middle but being skipped
    . for ease of reading purpose
          }  
     }  
     ### END /etc/grub.d/10_linux ###  
  8. After that, switch to your Ubuntu's grub.conf, and paste into ### BEGIN /etc/grub.d/40_custom ###, see screenshot below:

  9. Save the Ubuntu's grub.conf and reboot.
Voila! My Fedora 18 is now shown on the Grub boot menu.

2 comments:

  1. Hi I am Emre ı have Ubuntu 12.10 Secure Remix and Windows 8 with dual boot correct but I have install next fedora 18 but grub menulist is not coming and I did not get into other operatio sistem so I didn' open the other system.My ubuntu 12.10 grub files /boot/grub/grub.cnf or anywhere where is it location.My disk partition list is

    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 465.8G 0 disk
    ├─sda1 8:1 0 300M 0 part /boot/efi
    ├─sda2 8:2 0 600M 0 part
    ├─sda3 8:3 0 128M 0 part
    ├─sda4 8:4 0 186.3G 0 part
    ├─sda5 8:5 0 74.6G 0 part
    ├─sda6 8:6 0 19.5G 0 part
    ├─sda7 8:7 0 48.8G 0 part
    ├─sda8 8:8 0 20G 0 part
    ├─sda9 8:9 0 1M 0 part
    ├─sda10 8:10 0 111.6G 0 part /
    └─sda11 8:11 0 3.9G 0 part [SWAP]
    sr0 11:0 1 1024M 0 rom


    and I want to install sda7.Now my sistem is windows 8 and ubuntu 12.10 with multiboot correct.After install Fedora 18 do not boot any other system.

    ReplyDelete
    Replies
    1. I have not study in-depth on how to manually type in the grub.cfg, but if you are able to boot into your Fedora 18, then you can locate the grub.cfg of Ubuntu under its corresponding partition, copy & paste the Ubuntu's menuentry into your Fedora's grub.cfg.

      As for windows, I believe you can also get the menuentry under your Ubuntu's grub.cfg as well since you said they are dual-bootable before Fedora 18 was installed.

      There are a few resources you can read shall you want to dig into configuring grub2:
      http://www.gnu.org/software/grub/manual/grub.html

      http://members.iinet.net/~herman546/p20/GRUB2%20Configuration%20File%20Commands.html

      https://help.ubuntu.com/community/Grub2

      Good luck!

      Delete