When installing Linux and windows systems, windows is often installed first before Linux is installed, because windows will charge 0 for the primary sector record, thus damaging the primary boot record. After windows is installed and then Linux is installed, Linux installs grub to the primary boot sector, and then guides Linux and windows through the grub boot menu, the boot sequence is grub --> linux/(ntldr-> windows). The consequence is that if the Linux system fails or grub fails, windows will become unavailable.
If grub is not installed after Windows is installed and then Linux is installed, the Linux installer will not modify the primary boot sector, after installing Linux, install the grub program of windows under windows, enable ntldr of windows to guide grub, and then use grub to guide Linux. The boot sequence is ntldr-> windows/(grub-> linux ). Therefore, use this method to install the dual-system.
1. Install windows first
If there is only one hard disk, first partition the hard disk, first partition, so that Windows is installed in the first partition, follow the normal steps to install
2. Install Linux
During the installation process, pay attention to using the remaining partitions for operations during disk partitioning.
And does not install grub to the master boot record
After the installation, restart the system to check whether the system can normally access windows. If the system is normally connected to windows, View disk management, and view the current partition status.
3. View the Linux partition uuid
Use the Linux installation CD to enter emergency mode and view the uuid information of the Linux partition.
Enter linux recuse on the installation disc to enter emergency mode.
Select language
Select language
Select whether to configure the network.
Select coutinue and use automatic mode to automatically detect disk partitions, especially when volume groups are used.
Enter chroot/mnt/sysimage to switch to the root file system
Use blkid to view the uuid of the root file system
4. Install grub in Windows and configure the ntldr and grub boot menus.
Download the grub4dos-0.4.4 and unzip it to the windows c-drive root directory
Edit the boot. Ini file
[Boot loader]
Timeout = 30
Default = multi (0) disk (0) rdisk (0) partition (1) \ WINDOWS
[Operating systems]
Multi (0) disk (0) rdisk (0) partition (1) \ WINDOWS = "Windows Server 2003, Enterprise"/noexecute = optout/fastdetect
C: \ grldr = "grub"
Edit the menu. lst file
Title CentOS (2.6.18-308. el5)
Root (hd0, 1)
Kernel/vmlinuz-2.6.18-308.el5 ro root = UUID = f5762340-1fd9-4483-a628-ae3ab9f130b0 quiet
Initrd/initrd-2.6.18-308.el5.img
Since windows drive C is the first primary partition and Linux boot partition is the second primary partition (a separate partition is created for the boot directory when Linux is installed), root (hd0, 1) the second primary partition is used to find the Linux kernel file. root = UUID indicates the UUID of the system root partition (because uuid will not change, but sda1 and sda2 will change ).
5. Restart the test