Grub settings for CentOSUbuntu dual-system boot

Source: Internet
Author: User
1. Install CentOS first, then Ubuntu.2, and start it with the CentOS installation disk, run linuxrescue in shell to run chroot/mnt/sysimagegrub-install/dev/sda to fix grub of CentOS when the startup option appears, then reboot3. mount/dev/sda6/mediavi/media/boot/grub/gru to the Ubuntu partition mounted to CentOS.

1. Install CentOS first and then Ubuntu.
2. Use CentOS to install the disk and use linux rescue when the startup option appears.
Run in shell
Chroot/mnt/sysimage
Grub-install/dev/sda
Fix grub of CentOS, and then reboot
3. Enter CentOS
Mount the Ubuntu Partition
Mount/dev/sda6/media
Vi/media/boot/grub. cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by/usr/sbin/grub-mkconfig using templates
# From/etc/grub. d and settings from/etc/default/grub
#

### BEGIN/etc/grub. d/00_header ###
If [-s/boot/grub/grubenv]; then
Have_grubenv = true
Load_env
Fi
Set default = "0"
If [$ {prev_saved_entry}]; then
Saved_entry =$ {prev_saved_entry}
Save_env saved_entry
Prev_saved_entry =
Save_env prev_saved_entry
Fi
Insmod ext2
Set root = (hd0, 2)
Search -- no-floppy -- fs-uuid -- set 1a2b230e-d172-4b48-8395-72a33ebce462
If loadfont/usr/share/grub/unicode. pf2; then
Set gfxmode = 640x480
Insmod gfxterm
Insmod vbe
If terminal_output gfxterm; then true; else
# For backward compatibility with versions of terminal. mod that don't
# Understand terminal_output
Terminal gfxterm
Fi
Fi
If [$ {recordfail} = 1]; then
Set timeout =-1
Else
Set timeout = 10
Fi
### END/etc/grub. d/00_header ###

### BEGIN/etc/grub. d/05_debian_theme ###
Set menu_color_normal = white/black
Set menu_color_highlight = black/white
### END/etc/grub. d/05_debian_theme ###

### BEGIN/etc/grub. d/10_linux ###
Menuentry "Ubuntu, Linux 2.6.31-14-generic "{
Recordfail = 1
If [-n $ {have_grubenv}]; then save_env recordfail; fi
Set quiet = 1
Insmod ext2
Set root = (hd0, 2)
Search -- no-floppy -- fs-uuid -- set 1a2b230e-d172-4b48-8395-72a33ebce462
Linux/boot/vmlinuz-2.6.31-14-generic root = UUID = 1a2b230e-d172-4b48-8395-72a33ebce462 ro quiet splash
Initrd/boot/initrd. img-2.6.31-14-generic
}
Menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode )"{
Recordfail = 1
If [-n $ {have_grubenv}]; then save_env recordfail; fi
Insmod ext2
Set root = (hd0, 2)
Search -- no-floppy -- fs-uuid -- set 1a2b230e-d172-4b48-8395-72a33ebce462
Linux/boot/vmlinuz-2.6.31-14-generic root = UUID = 1a2b230e-d172-4b48-8395-72a33ebce462 ro single
Initrd/boot/initrd. img-2.6.31-14-generic
}
### END/etc/grub. d/10_linux ###

Www.linuxidc.com

Copy the following content with uuid
Linux/boot/vmlinuz-2.6.31-14-generic root = UUID = 1a2b230e-d172-4b48-8395-72a33ebce462 ro quiet splash
Initrd/boot/initrd. img-2.6.31-14-generic
Edit grub. conf of CentOS, add the copied content to grub. conf, and modify the content as follows:
Vi/boot/grub. conf
Title Ubuntu 9.10
Root (hd0, 0)
Kernel/vmlinuz-2.6.31-14-generic root = UUID = b2a79ba9-abbc-45dd-810d-2052cd782aea ro quiet splash
Initrd/initrd. img-2.6.31-14-generic

Vmlinuz and initrd under cp Ubuntu are under CentOS boot.
Cp/media/boot/vmlinuz-2.6.31-14-generic/boot/
Cp/media/boot/initrd. img-2.6.31-14-generic/boot/

Related Article

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.