安装过程如下:
1. 先在一块物理硬盘上安装Windows 7。
过程从略。
2. 再在另一块物理硬盘上安装CentOS 6.5。
过程从略。
3. 修改BIOS,将启动的第1顺序硬盘指向安装了CentOS 6.5的硬盘。
4. 修改/boot/grub/menu.lst文件
默认情况下,CentOS 6.5识别不出Windows系统,因此修改如下:
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Windows 7
rootnoverify (hd1,0)
chainloader +1
title CentOS (2.6.32-431.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS rd_NO_MD rd_LVM_LV=VolGroup/lv_swap crashkernel=128M LANG=zh_CN.UTF-8 rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-431.el6.x86_64.img
注意,这里比较关键的地方是rootnoverify (hd1,0),其中的(hd1,0)表示第二块硬盘的第一个分区。
那么为什么是hd1呢?
分析过程如下:
我的机器有3块硬盘,根据物理连线顺序,第1块是空闲的硬盘,第2块是安装了CentOS 6.5的硬盘,第3块是安装了Windows 7的硬盘。
关于这一点的确认,可以使用Windows中自带的磁盘管理工具看一下自己机器的硬盘:
或者在Linux下运行fdisk命令查看
[maping@localhost ~]$ sudo fdisk -l
Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xef5bbf6a
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2 64 38914 312057856 8e Linux LVM
Disk /dev/sdc: 500.1 GB, 500107862016 bytes
183 heads, 16 sectors/track, 333597 cylinders
Units = cylinders of 2928 * 512 = 1499136 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe057b8a1
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 82189 120324688 7 HPFS/NTFS
/dev/sdc2 82190 333596 368059848 f W95 Ext'd (LBA)
/dev/sdc5 82190 164378 120324688 7 HPFS/NTFS
/dev/sdc6 164379 246567 120324688 7 HPFS/NTFS
/dev/sdc7 246568 333596 127410448 7 HPFS/NTFS
Disk /dev/sda: 20.5 GB, 20520493056 bytes
255 heads, 63 sectors/track, 2494 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcc40cda0
Device Boot Start End Blocks Id System
Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_swap: 7331 MB, 7331643392 bytes
255 heads, 63 sectors/track, 891 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_home: 258.5 GB, 258524315648 bytes
255 heads, 63 sectors/track, 31430 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
那么,如此说来,Windows 7的启动硬盘设置应该是hd2,而CentOS 6.5启动硬盘设置应该是hd1。
为什么实际却是Windows 7的启动硬盘设置是hd1,而CentOS 6.5启动硬盘设置是hd0呢?
我想了一下,应该与BIOS中启动的硬盘顺序有关, 因为启动的第1顺序硬盘指向安装了CentOS 6.5,所以CentOS 6.5启动硬盘设置是hd0,以此类推,Windows 7的启动硬盘设置是hd1。
最后解释一下,因为我常用的工作平台是Windows 7,所以我把CentOS 6.5和 Windows 7启动选项交换了一下,将Windows 7作为默认启动系统。
没有评论:
发表评论