首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> 網頁程式設計 >> PHP 程式設計 >> PHP 相關知識

Dell T7500 工作站 Win7/RHEL 5.5 雙系統引導修復實戰:GRUB 重裝與配置調整

     編輯:PHP 相關知識

Dell T7500 工作站 Win7/RHEL 5.5 雙系統引導修復實戰

批量 Dell T7500 工作站運行 Win7/RHEL 5.5 雙系統,近期 Win7 系統盤頻發故障。更換新盤重裝 Win7 後,GRUB 被覆蓋導致無法進入 Linux。本文記錄使用 RHEL 光盤救援模式重裝 GRUB、調整啟動參數的完整操作流程。

一、 故障現象分析

  • 原裝 Win7 佔用 /dev/sda1 (Dell Utility 隱藏分區),系統在 /dev/sda2,GRUB 配置 rootnoverify (hd0,1)
  • 新盤僅分兩區,Win7 系統在 /dev/sda1,對應 rootnoverify (hd0,0)
  • 重裝 Win7 後 MBR 被 Windows Boot Manager 覆蓋,GRUB 丟失

二、 救援模式重裝 GRUB 步驟

  1. 插入 RHEL 5.5 安裝光盤,重啟按 F12 選擇光盤啟動
  2. 啟動畫面輸入 linux rescue 進入救援環境
  3. sh# fdisk -l | less 確認分區佈局,記錄 Linux 根分區位置 (如 /dev/sdb1)
  4. sh# grub 進入 GRUB 命令行
  5. grub> root (hd1,0) 設置根設備 (Linux 在第二塊盤第一分區)
  6. grub> setup (hd0) 將 GRUB 第一階段安裝到第一塊盤 MBR
  7. 見到 succeeded / Done. 表示安裝成功
  8. 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 與菜單配置。

四、 修正 grub.conf 啟動參數

進入 Linux 後,編輯 /etc/grub.conf:

title Other
    rootnoverify (hd0,0)   # 原 (hd0,1) 改為 (hd0,0)
    chainloader +1

保存退出,重啟驗證「Other」選項可正常進入 Win7。

五、 經驗總結與預防

  • 分區規劃先行:新盤分區務必與舊盤 GRUB 配置對齊,或預留隱藏分區佔位
  • 備份 MBR:dd if=/dev/sda of=/backup/mbr.bak bs=512 count=1 定期備份
  • 機箱除塵:灰塵積聚產生靜電,導致硬盤/主板故障率上升,定期清理機箱內部
  • 文檔化:將修復流程固化為運維手冊,新成員可按圖索駭
  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved