Install centos 5.8 dual system in win7

Source: Internet
Author: User

Last weekend, I saw that my machine was running slowly, and I didn't want to learn Linux from the virtual machine. So I wanted to install a dual system and saw that laruence's Private food was in centos 5. X for demonstration, simply install centos, Here installed centos version 5.8 centos 5.8, download the CentOS-5.8-i386-bin-DVD-1of2.iso and CentOS-5.8-i386-bin-DVD-1of2.iso these two images.

Insert an episode here, that is, there was a depressing thing when I installed win7. I divided it into four areas. After win7 was installed on the C drive, it is found that all partitions are dynamic. If you only use win7 as a system, it does not matter. However, if you want to install dual systems, it cannot be dynamic. Then, you can reinstall win7, however, at the time of partitioning, we found that the operation could not be performed, the deletion could not be performed, and the formatting could not be performed. Then, we checked the information and found that at the partitioning step, press SHIFT + F10 to bring up the DOS command prompt window and perform the following operations respectively:

1. type the diskpart command to enter the diskpart environment;

2. type the list disk command to list all local disks;

3. type the select disk 0 command and select the first disk;

4. type the clean command to clear the partition.

This step has actually solved the problem. You can refresh the returned partition interface to see the effect. Here, if you want to flexibly split the primary partition and the logical partition, it is very convenient in the DOS diskpart command environment. For example, create primary partition size = 51200 to create a 50 GB primary partition, and then use the active command to activate it, for example, the create partition extended command creates an extended partition. Here I have divided four partitions, one primary partition, three logical partitions, And the last partition. The size of the fdisk is 60 Gb. I am going to install my centos. Now, let's take a look at the centos installation method:

  • Prepare the boot disk
The boot disk can be a USB flash disk, hard disk, and CD. It is the easiest way to create a boot image using a USB flash disk and a CD. However, I have no such large USB flash disk on hand, choose to use the hard disk for installation. First, use the partitioning tool acronis disk ctor suite to separate 5 GB space from the E disk to store the centos Installation File. For convenience, it is called "installation partition" here. however, Linux only recognizes file systems such as ext2, ext3, ext4, and FAT32, so we can't finish the division. We know that windows also recognizes the FAT32 file system, therefore, the "installation partition" is formatted as the FAT32 system. In fact, the FAT32 system only recognizes files below 4 GB, if your centos image is larger than 4 GB, it cannot be placed under the FAT32 file system. You need to format the file system recognized by Linux such as ext3, use a tool such as ext2fs to put the installation image in it. If this tool is not used, Windows will not recognize the ext file system, let alone copy the file. Let's talk about the reason why we can use the FAT32 file system. We can see that the downloaded installation file has two ISO files. The first one is 3G less than 4g, and the second one is less than 1g, however, if it is added together, it is greater than 4G, but it doesn't matter. If it is smaller than 4G for a single file, it will be OK. Use ultraiso to set the isolinux/vmlinuz and isolinux/initrd in the CentOS-5.8-i386-bin-DVD-1of2.iso. IMG and IMGs put in our just-divided "Install partition", and finally "Install partition" should have five files, are CentOS-5.8-i386-bin-DVD-1of2.iso, CentOS-5.8-i386-bin-DVD-2of2.iso, vmlinuz, initrd. for IMG and IMGs, if you only put dvd1, you may be sprayed with blood when the installation is completed quickly, and an error cannot be found in the image. OK. Now we have prepared the boot disk.
  • Add Startup Menu
Download and install easybcd to add a startup item for the boot disk we just created to enter the installation stage. Open easybcd, addnewentry-> install-> config, and a TXT file will pop up. This file is actually a menulist file. Enter the following value in the file: Title centos 5.8 kernel (hd0, 6) /vmlinuzinitrd (hd0, 6)/initrd. save and exit IMG. Here, I will explain these things in menulist. The content after the title is just a title. If you write an incorrect title, the content is correct. The following kernel and initrd are actually vmlinuz and initrd. IMG path, whether your disk interface is ide or SATA, is marked with HD. For example, hd0 indicates your first disk, the second number in the brackets indicates the Partition Number on the corresponding disk. here you need to write the partition number corresponding to the "installation partition, my local partition is such a primary partition, drive C, two logical partitions, drive D and drive E, followed by a "installation partition" and the last drive F that was just removed from drive C, because the Partition Number is 0 ~ 3 is for the primary partition or scalable partition. Therefore, the Partition Number of drive C is 0, d, e, "installation partition", and F are 4, 5, 6, and 7, respectively. Do not write this error. Otherwise, the vmlinuz and initrd. imgfiles will fail to be found during installation. OK. Here we have added a boot item to our boot disk. Next, restart and select the second menu to go to the installation.
  • Install centos 5.8
This step is basically the pace of "Next". Note that you need to select sd7 when selecting the installation file. Otherwise, you will not be able to find the installation file. In fact, this is nothing, I really don't know how to drop my installation file into that partition. I will try it one by one, but it will always succeed. Next, the most important partition. Choose "create custom partition structure" and click "OK" here. At this time, we will see our disk partitions in the above area, I want to install it on the F disk, but this partition is generated when Windows 7 is installed. It is an NTFS file system. Therefore, we need to delete this partition first, at this time, we will see a number representing the size after free. OK, we will partition our Linux from this free. There are four zones, namely/,/boot,/home, and swap. the space I have provided in advance is relatively large, and there are 60 GB of space, therefore, 20 GB for/root, 200 MB for/boot, 4 GB for swap, And/home for the rest. All right, after these steps are completed, I will divide them into different sections. Next, we should pay attention to the installation of the pilot loader grub, we need to install it on the MBR for guidance. In fact, it is installed in the MBR by default./dev/hda indicates the MBR of the hard disk. There is a list area below, the menu that appears when you start the system.
  • Some guidance questions
Restart After installation. Grub is the default boot mode, and centos is the default system. However, if windows is used for most of the time, this is inconvenient, therefore, it is recommended to switch to the root user after entering the centos system, and then gedit/etc/grub. conf, and then change default = 0 to default = 1 to start Windows by default. So far, we have achieved success. Start your centos.
  • Others
At this point, it should be appropriate to be playing with windows or centos, but I did a headache. When we switch to win7, we will see the "installation partition" we made at the beginning. 5g is always awkward, and then I am idle to merge it with the adjacent edisk, everything seems perfect, but when I try to restart centos again, I find that grub cannot be started normally, and a grub command prompt appears, in fact, this is because after you merge a partition with another partition, the numbers of all the partitions after the merged partition are reduced by one, and you are at/etc/grub. root of conf
(Hd0, 7) is not applicable. It should be changed to (hd0, 6). Here the root command is used to set/boot partitions, because before the two partitions are not merged, there are C, D, E, "installation partition",/boot,/,/home,/swap, so/boot is (hd0, 7 ), however, after the E disk and the "installation partition" are merged, the/boot number should be (hd0, 6. OK, enter the following command at the grub Command Prompt: 1. Setup (hd0) // reinstall grub on MBR 2. Reboot
// At this time, the grub command prompt will still appear. This is for sure, because we have not modified gurb. CONF file: 1. root (hd0, 6) // set/boot partition 2. kernel/vmlinuz-2.6.18.308.e15 Ro root = label =/rhgb quiet // you can use the tab key to complete 3. initrd/initrd-2.6.18.308.e15.img // you can use the tab key to complete 4. bootok, we will see that our centos can be started again! After entering, remember to set/boot/GRUB/grub. the conf file is changed to the/boot Partition Number. Here I change (hd0, 7) to (hd0, 6 ).
  • Finally, I would like to thank my lovely wife for staying with me, ^ _ ^.
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.