After Ubuntu is installed, Fedora in the Grub boot option is missing.

Source: Internet
Author: User
I installed Fedora17 for testing because of my work. I 'd like to try it out. However, after using it for a while, I am still not used to it. So I installed Ubuntu12.04, I didn't expect that after installation, why did the Fedora IN THE Grub2 boot option disappear? Even if the/boot/grub. cfg is re-generated using update-grub in Ubuntu, the Fedora is not displayed. To find out,

Originally, due to work, I installed the Fedora 17 test and wanted to try it out. However, after using it for a while, I still don't get used to it. So I installed Ubuntu 12.04, I didn't expect that after installation, why did the Fedora IN THE Grub2 boot option disappear? Even if the/boot/grub. cfg is re-generated using update-grub in Ubuntu, the Fedora is not displayed.

To check whether the partition where Fedora is installed is mounted, it seems strange that there is no grub. cfg file under/boot/grub? I also noticed that there is another grub2 directory under/boot, which contains the grub. cfg file. Why? No way. Since there is a grub. cfg file here, I will help Grub2 Add a project under Ubuntu and copy the ora boot content from this grub. cfg file.

The first option (default is to start Fedora) in/boot/grub2/grub. cfg under Fedora is as follows:

### BEGIN/etc/grub. d/10_linux ###
Menuentry 'ora ora Linux '-- class Fedora -- class gnu-linux -- class gnu -- class OS $ menuentry_id_option' gnulinux-simple-33f4c026-0cb9-4b61-bf8d-17b4b8779488 '{
Load_video
Set gfxpayload = keep
Insmod gzio
Insmod part_msdos
Insmod ext2
Set root = 'hd0, msdoss'
If [x $ feature_platform_search_hint = xy]; then
Search -- no-floppy -- fs-uuid -- set = root -- hint-bios = hd0, msdos8 -- hint-efi = hd0, msdos8 -- hint-baremetal = ahci0, msdos8 -- hint = 'hd0, msdoss' 33f4c026-0cb9-4b61-bf8d-17b4b8779488
Else
Search -- no-floppy -- fs-uuid -- set = root 33f4c026-0cb9-4b61-bf8d-17b4b8779488
Fi
Echo 'loading Linux 3.3.4-5. fc17.x86 _ 64 ...'
Linux/boot/vmlinuz-3.3.4-5.fc17.x86_64 root = UUID = 33f4c026-0cb9-4b61-bf8d-17b4b8779488 ro rd. md = 0 rd. lvm = 0 rd. dm = 0 SYSFONT = True KEYTABLE = us rd. luks = 0 LANG = en_US.UTF-8 rhgb quiet
Echo 'loading initial ramdisk ...'
Initrd/boot/initramfs-3.3.4-5.fc17.x86_64.img
}
Copy this section and paste it to/etc/grub. d/The following presets are provided to us as the 40_custom file of the template (it is the most convenient to use the paste, otherwise you have to study the Grub2 command, it is also prone to errors ):

#! /Bin/sh
Exec tail-n + 3 $0
# This file provides an easy way to add custom menu entries. Simply type
# Menu entries you want to add after this comment. Be careful not to change
# The 'exec tail' line above.
Menuentry 'ora ora Linux '-- class Fedora -- class gnu-linux -- class gnu -- class OS $ menuentry_id_option' gnulinux-simple-33f4c026-0cb9-4b61-bf8d-17b4b8779488 '{
Load_video
Set gfxpayload = keep
Insmod gzio
Insmod part_msdos
Insmod ext2
Set root = 'hd0, msdoss'
If [x $ feature_platform_search_hint = xy]; then
Search -- no-floppy -- fs-uuid -- set = root -- hint-bios = hd0, msdos8 -- hint-efi = hd0, msdos8 -- hint-baremetal = ahci0, msdos8 -- hint = 'hd0, msdoss' 33f4c026-0cb9-4b61-bf8d-17b4b8779488
Else
Search -- no-floppy -- fs-uuid -- set = root 33f4c026-0cb9-4b61-bf8d-17b4b8779488
Fi
Echo 'loading Linux 3.3.4-5. fc17.x86 _ 64 ...'
Linux/boot/vmlinuz-3.3.4-5.fc17.x86_64 root = UUID = 33f4c026-0cb9-4b61-bf8d-17b4b8779488 ro rd. md = 0 rd. lvm = 0 rd. dm = 0 SYSFONT = True KEYTABLE = us rd. luks = 0 LANG = en_US.UTF-8 rhgb quiet
Echo 'loading initial ramdisk ...'
Initrd/boot/initramfs-3.3.4-5.fc17.x86_64.img
}
Note that the first two lines cannot be changed. You only need to paste the copied content to the explain command starting with # And then use the update-grub command, we can see that Fedora is automatically found this time:

Www.linuxidc.com @ www.linuxidc.com :~ $ Sudo update-grub
Generating grub. cfg...
Found linux image:/boot/vmlinuz-3.2.0-26-generic
Found initrd image:/boot/initrd. img-3.2.0-26-generic
Found linux image:/boot/vmlinuz-3.2.0-23-generic
Found initrd image:/boot/initrd. img-3.2.0-23-generic
Found memtest86 + image:/boot/memtest86 +. bin
Found Windows 8 (loader) on/dev/sda1
Found Fedora release 17 (Beefy Miracle) on/dev/sda8
Done
Then, you just need to reboot the system and we can see that there are two Fedora 17 options on the boot menu. One is the one I just added, which is customized by 40_custom, the other is automatically found through OS-Prober through the update-grub command. Although both options can start Fedora, but the content displayed in the process is not the same, the OS-Prober automatically finds the option to start mostly text before entering the drawing mode, the option copied from the original ora configuration file enters the drawing mode very early on, which is more beautiful.

Later I found that, as long as I mount the partition where Fedora 17 is installed, the OS-Prober action will automatically find Fedora. In addition, I don't know why Fedora wants to put grub. cfg under/boot/grub2, but according to the Fedora file, this is indeed the case.

The official GNU Grub2 file is here for reference (but it is difficult to read ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.