批量 Dell T7500 工作站運行 Win7/RHEL 5.5 雙系統,近期 Win7 系統盤頻發故障。更換新盤重裝 Win7 後,GRUB 被覆蓋導致無法進入 Linux。本文記錄使用 RHEL 光盤救援模式重裝 GRUB、調整啟動參數的完整操作流程。
/dev/sda1 (Dell Utility 隱藏分區),系統在 /dev/sda2,GRUB 配置 rootnoverify (hd0,1)/dev/sda1,對應 rootnoverify (hd0,0)linux rescue 進入救援環境sh# fdisk -l | less 確認分區佈局,記錄 Linux 根分區位置 (如 /dev/sdb1)sh# grub 進入 GRUB 命令行grub> root (hd1,0) 設置根設備 (Linux 在第二塊盤第一分區)grub> setup (hd0) 將 GRUB 第一階段安裝到第一塊盤 MBRsucceeded / Done. 表示安裝成功grub> quit 退出,sh# reboot 重啟grub> root (hd1,0) Filesystem type is ext2fs, partition type 0xfd grub> setup (hd0) Checking if "/boot/grub/stage1" exists... yes Checking if "/boot/grub/stage2" exists... yes Checking if "/boot/grub/e2fs_stage1_5" exists... yes Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded. succeeded Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded Done.
embed 將 stage1_5 嵌入 MBR 後扇區,支援 ext2/3/4 文件系統;install 寫入 stage1 並指向 stage2 與菜單配置。
進入 Linux 後,編輯 /etc/grub.conf:
title Other
rootnoverify (hd0,0) # 原 (hd0,1) 改為 (hd0,0)
chainloader +1
保存退出,重啟驗證「Other」選項可正常進入 Win7。
dd if=/dev/sda of=/backup/mbr.bak bs=512 count=1 定期備份