通过grub4dos引导vista和linux的双系统

  • user warning: Table './zgq_smzz/blog_comments' is marked as crashed and should be repaired query: SELECT COUNT(*) FROM blog_comments c WHERE c.nid = 29 AND c.status = 0 in /home/www/zhouguoqiang/zhoume.org/modules/comment/comment.module on line 992.
  • user warning: Table './zgq_smzz/blog_comments' is marked as crashed and should be repaired query: SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.signature_format, u.picture, u.data, c.thread, c.status FROM blog_comments c INNER JOIN blog_users u ON c.uid = u.uid WHERE c.nid = 29 AND c.status = 0 ORDER BY c.thread DESC LIMIT 0, 50 in /home/www/zhouguoqiang/zhoume.org/modules/comment/comment.module on line 992.

机子里以前装的是Win XP和Linux双系统,出于追mm以及紧跟潮流的考虑,我重新格式化装有XP的C盘,并安装了Vista。双系统的引导成了问题,从网上搜索发现,grub4dos也在与时俱进,支持vista的引导。于是我决定通过在Vista下面安装groub4dos引导Linux。

根据grub4dos的教程,我先在命令提示符下运行
bcdedit /create /d "GRUB for DOS" /application bootsector
得到了一个类似{05d33150-3fde-11dc-a457-00021cf82fb0}的id字符串
紧接着运行如下命令,
bcdedit /set {id} device boot
bcdedit /set {id} path \grldr.mbr
bcdedit /displayorder {id} /addlast
其中,{id}就是先前得到的带花括号的id字符串。

然后,将GRLDR.MBR拷贝至Vista系统盘的根目录下,如C:\。同时,也将GRLDR和menu.lst拷到系统盘的根目录下(readme文件里说的是任意FAT16/FAT32/EXT2/NTFS分区的根目录下均可,不过我没来得及尝试)。

需要注意的是,C:\GRLDR文件本来就存在,任意改个名字即可。

然后修改Grub4dos的菜单文件(C:\menu.lst)和配置Windows的系统启动(系统属性 / 高级 / 启动故障和恢复)即可。

附上我的menu.lst文件内容,均可以正常启动:
color black/cyan yellow/cyan
timeout 30
default /default

title Windows Vista
find --set-root /bootmgr
chainloader /bootmgr

title Slackware 12.0
root (hd0,6)
kernel /boot/vmlinuz root=/dev/sda7 ro vga=791

与2k/xp不同的是,先进入grub4dos的界面,然后可进入Vista的引导界面。文件名等种种迹象标明,vista的启动管理器似乎是将grub4dos写在MBR里了。

Update:
某激活软件用的也是grub4dos,进行上面某一项设置的时候可能会导致无法激活。如果是多系统,建议通过Linux将Grub重新写在MBR,再通过Grub引导windows。不推荐使用grub4dos,感觉更混乱。

btw,通过live cd或硬盘进入linux,运行grub进入grub>提示符界面后,可通过如下命令恢复mbr:
grub>root (hd0,3) #指定linux分区所在位置
grub>setup (hd0) #将grub装到/dev/hda的MBR区。
grub>quit #大功告成,退出grub界面

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options