Summary of hard drive Linux installation in Win7

Source: Internet
Author: User

Not long ago, John was idle recently and installed CentOS on it. I encountered some problems in the middle. Here I will make a summary for your reference.

The purpose is to install CentOS from the hard disk in the existing Win7 system without disrupting the one-key restoration function provided by the computer.


Environment or software:

Win7 64-bit flagship Edition

CentOS image (using a minimal CentOS-6.2-x86_64-minimal.iso)

Grub4dos

EasyBCD


Preparation or knowledge:

You need to prepare a FAT32 partition, copy the CentOS-6.2-x86_64-minimal.iso to the root directory of the partition, and extract the images folder and place it in the root directory.

If it is not in the root directory, modify the relevant path in step 1 below. Do not use NTFS partition. Try to use NTFS partition to start the Linux installation program normally. However, the iso image cannot be found in step 1 below.

The hard disk reserves an unallocated area or an existing partition (either primary partition or logical partition, about 10 Gb) for CentOS installation.
Windows partition naming rules: (hdX, Y), where X indicates the hard disk number, starting from 0; Y indicates the Partition Number, starting from 0, because a maximum of four primary partitions are allowed, so 0 ~ 3 indicates the first to fourth primary partitions, and the logical Partition Number starts from 4. For example: (hd0, 0) indicates the first primary partition of the first hard disk, (hd1, 4) the first logical partition of the second hard disk.

Linux partition naming rules:/dev/sdaX, where X indicates the Partition Number, starting from 1. Therefore, in Windows (hd0, 0), it is/dev/sda1 in Linux, and so on.


The procedure is as follows:
1. download the latest version of grub4dos, decompress it, and copy the grldr, grldr. mbr, and menu. lst files to the root directory of the disk (assumed as drive c) where the Win7 system is located.

Http://download.gna.org/grub4dos/

2. Execute the following commands (administrator privilege required) in sequence at the doscommand prompt to add a new Win7 boot item.

Bcdedit/create/d "GRUB4DOS"/application bootsector
The command result should return a GUID, which is used by the subsequent command
Bcdedit/set {GUID} device partition = C:
Bcdedit/set {GUID} path/grldr. mbr
Bcdedit/displayorder {GUID}/addlast

The specific meaning can be seen in bcdedit's help (bcdedit /?).
3. Modify the menu. lst file and add the following content at the appropriate location.

Title Install CentOS-6.2-x86_64-minimal.iso
Fallback 9
Find -- set-root/CentOS-6.2-x86_64-minimal.iso
Map/CentOS-6.2-x86_64-minimal.iso (0xff) | map -- mem/CentOS-6.2-x86_64-minimal.iso (0xff)
Map -- hook
Chainloader (0xff)
Savedefault -- wait = 2

Where title is the title of the option, fallback indicates that the item that fails to jump to the corresponding number (starting from 0), find will automatically search for the CentOS-6.2-x86_64-minimal.iso at the specified position of each partition.

4. restart the computer, select "GRUB4DOS" in the boot item, enter grub4dos, and then select "Install CentOS-6.2-x86_64-minimal.iso".
5. Go to the CentOS installation page and select "Hard Disk" or "Hard Driver" from the installation source ), select the partition/dev/sdaX where the iso image is located (if you do not know the number of X, try one by one. If the iso image is placed under the root directory, leave the path blank.

6. When selecting a partition, you must be careful. If you make a wrong choice, it will be a tragedy.

7. When installing the Boot Loader, select the partition where the Linux instance is located and do not install the Boot Loader in MBR. Otherwise, the restoration function may fail with one click.

8. After the installation is complete and restart, you will not see the CentOS startup Item. If you are not in a hurry, use the advanced Win7 software and Add new entry-> Add one in Linux, note that the right partition is selected (the one that identifies Linux ).

9. restart the system and you will see the CentOS startup Item. All operations have been completed.


Postscript:

Possible problems:

1. if you delete the partitions in front of the Linux partition during use, the system will stop at the grub> command prompt when you enter Linux. This is because the partition number has been deleted and changed. Just fix it, enter "setup -- prefix = (hdX, Y)/boot/grub" at the grub> command prompt ".

2. Too many logical partitions (I guess this is the reason) will cause the one-click Restore function to fail to be started. After the partition is reduced, it can be started normally.



From LiXianlin's Blog

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.