Install Windows7 + Ubuntu13.04 + CentOS7

Source: Internet
Author: User

Install Windows7 + Ubuntu13.04 + CentOS7

(Note: after using a USB flash drive to create a boot disk for CentOS7, you do not need to delete the package or copy the image file or something. You can directly use it after burning it, I tested the installation of two desktops and one notebook, but there is no problem, but during the installation, You need to modify the location of the USB flash drive, as shown below :)

During the installation process with a USB flash drive, on the installation page, press the tab key to modify or press the e key directly: (direct installation is not successful and needs to be modified)

Vmlinuz initrd = initrd. img inst. stage2 = hd: LABEL = CentOS \ x207 \ x20x86_64 rd. live. check quiet:

Vmlinuz initrd = initrd. img inst. stage2 = hd:/dev/sdb4 quiet

Among them, hd:/dev/sdb4 is the location of the USB flash drive, which may be different. I am here. Other friends who are browsing the Internet have sda1. I don't know if the USB flash drive is different or why.

After centos7 is installed on the third system, the system fails to Boot Windows 7.

Solution: Use centos as the boot System

Method: Modify the/boot/grub2/grub. cfg file, that is, add a script to the file to guide windows.

Menuentry 'windows 7 (loader) (on/dev/sda1) '-- class Windows -- class OS $ menuentry_id_option 'osprober-chain-XXX '{
Insmod chain
Insmod part_msdos
Insmod ntfs
Set root = 'hd0, msdos1'
Chainloader + 1
}

Or, add this

Menuentry 'win7 '{
Insmod chain
Insmod ntfs
Set root = (hd0, msdos1)
Chainloader + 1
}

Menuentry 'win7 search '{
Insmod chain
Insmod ntfs
Search-f/ntldr -- set root
Chainloader + 1
}

I can see another method on the Internet to solve the problem. However, I did a test and it cannot be implemented. But write it as a reference.

#---------------------------------------------------


Steps:

1. Switch to the root user

Su


2. execute commands


Grub2-mkconfig-o/boot/grub2/grub. cfg

The execution details are as follows:

Bytes -------------------------------------------------------------------------------------

[Root @ localhost jiezh] # grub2-mkconfig-o/boot/grub2/grub. cfg
Generating grub configuration file...
Found linux image:/boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd image:/boot/initramfs-3.10.0-123.el7.x86_64.img
Found linux image:/boot/vmlinuz-3.10.0-123.4.2.el7.x86_64
Found initrd image:/boot/initramfs-3.10.0-123.4.2.el7.x86_64.img
Found linux image:/boot/vmlinuz-0-rescue-70ff68ea7ac34677a25f45f3417dd76c
Found initrd image:/boot/initramfs-0-rescue-70ff68ea7ac34677a25f45f3417dd76c.img
Found Windows 7 (loader) on/dev/sdb1
Done


Bytes -------------------------------------------------------------------------------------
After the repair is completed, you can see the Windows 7 boot after the startup and restart (it cannot be performed on my computer)
I made # sudo update-grub2 on Ubuntu

However, the above Windows 7 guidance can be implemented.


#---------------------------------------------------

The complete code for this file is as follows:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# From/etc/grub. d and settings from/etc/default/grub
#

### BEGIN/etc/grub. d/00_header ###
Set pager = 1

If [-s $ prefix/grubenv]; then
Load_env
Fi
If ["$ {next_entry}"]; then
Set default = "$ {next_entry }"
Set next_entry =
Save_env next_entry
Set boot_once = true
Else
Set default = "$ {saved_entry }"
Fi

If [x "$ {feature_menuentry_id}" = xy]; then
Menuentry_id_option = "-- id"
Else
Menuentry_id_option = ""
Fi

Export menuentry_id_option

If ["$ {prev_saved_entry}"]; then
Set saved_entry = "$ {prev_saved_entry }"
Save_env saved_entry
Set prev_saved_entry =
Save_env prev_saved_entry
Set boot_once = true
Fi

Function savedefault {
If [-z "$ {boot_once}"]; then
Saved_entry = "$ {chosen }"
Save_env saved_entry
Fi
}

Function load_video {
If [x $ feature_all_video_module = xy]; then
Insmod all_video
Else
Insmod efi_gop
Insmod efi_uga
Insmod ieee1275_fb
Insmod vbe
Insmod vga
Insmod video_bochs
Insmod video_cirrus
Fi
}

Terminal_output console
If [x $ feature_timeout_style = xy]; then
Set timeout_style = menu
Set timeout = 5
# Fallback normal timeout code in case the timeout_style feature is
# Unavailable.
Else
Set timeout = 5
Fi
### END/etc/grub. d/00_header ###

### BEGIN/etc/grub. d/10_linux ###
Menuentry 'centos Linux, with Linux 3.10.0-123. el7.x86 _ 64' -- class centos -- class gnu-linux -- class gnu -- class OS -- unrestricted $ menuentry_id_option 'gnulinux-3.10.0-123. el7.x86 _ 64-advanced-8091b91e-1049-4c97-8e64-59fa7cda6671 '{
Load_video
Set gfxpayload = keep
Insmod gzio
Insmod part_msdos
Insmod xfs
Set root = 'hd0, msdos10'
If [x $ feature_platform_search_hint = xy]; then
Search -- no-floppy -- fs-uuid -- set = root -- hint-bios = hd0, msdos10 -- hint-efi = hd0, msdos10 -- hint-baremetal = ahci0, msdos10 -- hint = 'hd0, msdos10. ab21651b-b9d9-403a-9115-f288ca6b7bd5
Else
Search -- no-floppy -- fs-uuid -- set = root ab21651b-b9d9-403a-9115-f288ca6b7bd5
Fi
Linux16/vmlinuz-3.10.0-123.el7.x86_64 root = UUID = 8091b91e-1049-4c97-8e64-59fa7cda6671 ro rd. lvm. lv = centos/swap vconsole. font = latarcyrheb-sun16 rd. lvm. lv = centos/root crashkernel = auto vconsole. keymap = us rhgb quiet LANG = zh_CN.UTF-8
Initrd16/initramfs-3.10.0-123.el7.x86_64.img
}


Menuentry 'windows 7 (loader) (on/dev/sda1) '-- class Windows -- class OS $ menuentry_id_option 'osprober-chain-XXX '{
Insmod chain
Insmod part_msdos
Insmod ntfs
Set root = 'hd0, msdos1'
Chainloader + 1
}

 

Menuentry 'centos Linux, with Linux output' -- class CentOS -- class gnu-linux -- class gnu -- class OS -- unrestricted $ menuentry_id_option 'gnulinux-encoding '{
Load_video
Insmod gzio
Insmod part_msdos
Insmod xfs
Set root = 'hd0, msdos10'
If [x $ feature_platform_search_hint = xy]; then
Search -- no-floppy -- fs-uuid -- set = root -- hint-bios = hd0, msdos10 -- hint-efi = hd0, msdos10 -- hint-baremetal = ahci0, msdos10 -- hint = 'hd0, msdos10. ab21651b-b9d9-403a-9115-f288ca6b7bd5
Else
Search -- no-floppy -- fs-uuid -- set = root ab21651b-b9d9-403a-9115-f288ca6b7bd5
Fi
Linux16/vmlinuz-0-rescue-a9741edb99374138ad3514311cc1ba77 root = UUID = 8091b91e-1049-4c97-8e64-59fa7cda6671 ro rd. lvm. lv = centos/swap vconsole. font = latarcyrheb-sun16 rd. lvm. lv = centos/root crashkernel = auto vconsole. keymap = us rhgb quiet
Initrd16/initramfs-0-rescue-a9741edb99374138ad3514311cc1ba77.img
}
If ["x $ default" = 'centos Linux, with Linux 3.10.0-123. el7.x86 _ 64']; then default = 'advanced options for CentOS Linux> CentOS Linux, with Linux 3.10.0-123. el7.x86 _ 64'; fi;
### END/etc/grub. d/10_linux ###

### BEGIN/etc/grub. d/20_linux_xen ###
### END/etc/grub. d/20_linux_xen ###

### BEGIN/etc/grub. d/20_ppc_terminfo ###
### END/etc/grub. d/20_ppc_terminfo ###

### BEGIN/etc/grub. d/30_os-prober ###
Menuentry 'ubuntu 13.04 (13.04) (on/dev/sda9) '-- class gnu-linux -- class gnu -- class OS $ menuentry_id_option 'osprober-gnulinux-simple-0cbece5c-328e-4f94-aa52-da220cca34a2 '{
Insmod part_msdos
Insmod ext2
Set root = 'hd0, msdos9'
If [x $ feature_platform_search_hint = xy]; then
Search -- no-floppy -- fs-uuid -- set = root -- hint-bios = hd0, msdos9 -- hint-efi = hd0, msdos9 -- hint-baremetal = ahci0, msdos9 -- hint = 'hd0, msdos9' 0cbece5c-328e-4f94-aa52-da220cca34a2
Else
Search -- no-floppy -- fs-uuid -- set = root 0cbece5c-328e-4f94-aa52-da220cca34a2
Fi
Linux/boot/vmlinuz-3.8.0-19-generic root = UUID = 0cbece5c-328e-4f94-aa52-da220cca34a2 ro locale = zh_CN quiet splash $ vt_handoff
Initrd/boot/initrd. img-3.8.0-19-generic
}
Submenu 'advanced options for Ubuntu 13.04 (13.04) (on/dev/sda9) '$ menuentry_id_option 'osprober-gnulinux-advanced-0cbece5c-328e-4f94-aa52-da220cca34a2 '{
Menuentry 'ubuntu (on/dev/sda9) '-- class gnu-linux -- class gnu -- class OS $ menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.8.0-19-generic -- detail '{
Insmod part_msdos
Insmod ext2
Set root = 'hd0, msdos9'
If [x $ feature_platform_search_hint = xy]; then
Search -- no-floppy -- fs-uuid -- set = root -- hint-bios = hd0, msdos9 -- hint-efi = hd0, msdos9 -- hint-baremetal = ahci0, msdos9 -- hint = 'hd0, msdos9' 0cbece5c-328e-4f94-aa52-da220cca34a2
Else
Search -- no-floppy -- fs-uuid -- set = root 0cbece5c-328e-4f94-aa52-da220cca34a2
Fi
Linux/boot/vmlinuz-3.8.0-19-generic root = UUID = 0cbece5c-328e-4f94-aa52-da220cca34a2 ro locale = zh_CN quiet splash $ vt_handoff
Initrd/boot/initrd. img-3.8.0-19-generic
}
Menuentry 'ubuntu, Linux 3.8.0-19-generic (on/dev/sda9) '-- class gnu-linux -- class gnu -- class OS $ menuentry_id_option' osprober-gnulinux-/boot/vmlinuz-3.8.0-19-generic -- 0cbece5c-328e-4f94-aa52-da220cca34a2 '{
Insmod part_msdos
Insmod ext2
Set root = 'hd0, msdos9'
If [x $ feature_platform_search_hint = xy]; then
Search -- no-floppy -- fs-uuid -- set = root -- hint-bios = hd0, msdos9 -- hint-efi = hd0, msdos9 -- hint-baremetal = ahci0, msdos9 -- hint = 'hd0, msdos9' 0cbece5c-328e-4f94-aa52-da220cca34a2
Else
Search -- no-floppy -- fs-uuid -- set = root 0cbece5c-328e-4f94-aa52-da220cca34a2
Fi
Linux/boot/vmlinuz-3.8.0-19-generic root = UUID = 0cbece5c-328e-4f94-aa52-da220cca34a2 ro locale = zh_CN quiet splash $ vt_handoff
Initrd/boot/initrd. img-3.8.0-19-generic
}
Menuentry 'ubuntu, Linux 3.8.0-19-generic (recovery mode) (on/dev/sda9) '-- class gnu-linux -- class gnu -- class OS $ menuentry_id_option' osprober-gnulinux-/boot/vmlinuz-3.8.0-19-generic -- 0cbece5c-328e-4f94-aa52-da220cca34a2 '{
Insmod part_msdos
Insmod ext2
Set root = 'hd0, msdos9'
If [x $ feature_platform_search_hint = xy]; then
Search -- no-floppy -- fs-uuid -- set = root -- hint-bios = hd0, msdos9 -- hint-efi = hd0, msdos9 -- hint-baremetal = ahci0, msdos9 -- hint = 'hd0, msdos9' 0cbece5c-328e-4f94-aa52-da220cca34a2
Else
Search -- no-floppy -- fs-uuid -- set = root 0cbece5c-328e-4f94-aa52-da220cca34a2
Fi
Linux/boot/vmlinuz-3.8.0-19-generic root = UUID = 0cbece5c-328e-4f94-aa52-da220cca34a2 ro recovery nomodeset locale = zh_CN
Initrd/boot/initrd. img-3.8.0-19-generic
}
}

### END/etc/grub. d/30_os-prober ###

### BEGIN/etc/grub. d/40_custom ###
# 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.
### END/etc/grub. d/40_custom ###

### BEGIN/etc/grub. d/41_custom ###
If [-f $ {config_directory}/custom. cfg]; then
Source $ {config_directory}/custom. cfg
Elif [-z "$ {config_directory}"-a-f $ prefix/custom. cfg]; then
Source $ prefix/custom. cfg;
Fi
### END/etc/grub. d/41_custom ###

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.