您的位置:首页 > 运维架构 > Linux

thinkpad t430 grub2 efi 引导fedora20/linux windows8双系统

2014-05-03 20:44 666 查看
去年新买了thinkpad t430的本本,到手后就装了个Fedora系统(http://user.qzone.qq.com/416702736/blog/1382273851),但是win7再也进不去了。尽管windows对于我来说用处不大,但是没有windows还是不爽的。期间把grub2 efi折腾了个遍,就是启动不了windows。终于在这个五一静下心来参考尝试了前人的n种方法,成功的引导了windows。现在想来关键在于重建BCD,因为在装Fedora时重新分区了。

1. 创建u盘启动的windows 8安装盘。格式化u盘为fat32个格式,直接解压windows8 ISO文件到U盘即可。这里我之前用的是windows7,尝试过n种制作启动盘的方法,却只能legancy启动,一直不能efi启动。用了window8后居然这么简单,看来window8对efi的支持要好多了呀。

2. 选择从U盘启动安装windows8(按F12),替换了window7,可怜我的正版window7呀。安装过程中会重启,X,又进不去windows8了,难道难道这么多的努力白费了。于是进行下面的步骤。

3. 拷贝window8安装分区下的Windows/Boot到/boo/efi/EFI/Miscrosoft下面,我的efi相关分区如下

/dev/sdb4 499656 79704 383256 18% /boot

/dev/sdb1 102182 45340 56842 45% /boot/efi

得到的/boo/efi/EFI/Miscrosoft目录结构如下

`-- Boot

|-- DVD

|-- EFI

|-- Fonts

|-- PCAT

`-- Resources

4. 增加如下到/etc/grub.d/40_custom

menuentry 'windows' --class windows --class os {

insmod part_gpt

insmod fat

insmod search_fs_uuid

insmod chain

search --no-floppy --fs-uuid --set=root
B0DD-6568

chainloader ($root)/EFI/Microsoft/Boot/EFI/bootmgfw.efi

}

其中的红色高亮部分,通过如下方式查看

ls /dev/disk/by-uuid/ -l

找到/boo/efi对应分区的uuid,这里如下

lrwxrwxrwx 1 root root 10 May 3 14:59 B0DD-6568 -> ../../sdb1

5. grub2-mkconfig -o /boot/grub2/grub.cfg更新grub2配置文件

6. 重启,仍然选择从U盘启动, click Repair
your computer > click Troubleshoot >
click Advanced options >
choose Command Prompt

type
> bootrec /fixmbr (writes
mbr but does not overwrite partition table)

type > bootrec
/fixboot (writes new boot sector to system partition)

type > bootrec
/scanos (scans for other OS’s that you might want to add to bcd)

(personally I find the above unneeded and only use the last step)

type > bootrec
/rebuildbcd (scans for other OS’s, unlike rebuildbcd it allows you to select the OS’s you want to add to bcd)

7. 重启,拔掉U盘(不需要window8安装盘了)选择grub2启动项的windows,继续安装完windows。

8. 安装完成后大功告成,从grub2的启动项既可以选择启动windows,也可以启动Fedora。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: