無法載入 rootfs:Ubuntu 10 + grub2 + rootfs ext4 w/ RAID1

無法載入 rootfs:Ubuntu 10 + grub2 + rootfs ext4 w/ RAID1

我在啟動新的 Ubuntu 10(伺服器)安裝時遇到問題。我的主硬碟 (/dev/sda) 的佈局如下:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          18      144553+  83  Linux                  <-- /BOOT
/dev/sda2              19      182401  1464991447+   5  Extended
/dev/sda5              19        2207    17583111   fd  Linux raid autodetect
/dev/sda6            2208       11934    78132096   fd  Linux raid autodetect  <-- / (ROOTFS)
/dev/sda7           11935      182401  1369276146   fd  Linux raid autodetect

rootfs 是 RAID1(軟體)陣列的一部分(目前已降級):

# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md2 : active raid1 sda6[1]
      78132032 blocks [2/1] [_U]

分區的 UUID 如下:

# blkid /dev/sda1
/dev/sda1: UUID="b25dd301-41b9-4f4d-9b0a-0e31713dd74c" TYPE="ext2"
# blkid /dev/sda6
/dev/sda6: UUID="af7b9ede-fa53-c0c1-74be-31ec752c5cd5" TYPE="linux_raid_member"
# blkid /dev/md2
/dev/md2: UUID="a0602d42-6855-482f-870c-6f6ecdcdae3f" TYPE="ext4"

最後,我的 grub2 選單項目設定如下:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-25-server' --class ubuntu --class gnu-linux --class gnu --class os {
        insmod ext2
        insmod raid
        insmod mdraid
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set b25dd301-41b9-4f4d-9b0a-0e31713dd74c
        linux   /vmlinuz-2.6.32-25-server root=UUID=a0602d42-6855-482f-870c-6f6ecdcdae3f ro   nosplash noplymouth
        initrd  /initrd.img-2.6.32-25-server
}

當我嘗試啟動時,grub 加載正常,但我最終收到以下錯誤訊息:

Gave up waiting for root device. Common problems:
  — Boot args (cat /proc/cmdline)
    — Check rootdelay= (did the system wait long enough?)
    — Check root= (did the system wait for the right device?)
  — Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/disk/by-uuid/a0602d42-6855-482f-870c-6f6ecdcdae3f does not exist.   
Dropping to a shell! 

如果從grub 引導程式開啟grub> 命令列,我可以ls (hd0,) 並列出帶有UUID 的正確分割區,如上所示- sda6 顯示「a0602d42-6855-482f-870c-6f6ecdcdae3f」(RAID UUID ) )。如果我 ls (md2)/ 它會正確列出 RAID1 文件系統 (ext4) 上的所有文件,因此訪問 raid 設備似乎不會出現問題。

有人對可能出現的問題有什麼建議嗎?我無法弄清楚這一點。

答案1

我最終透過谷歌找到了答案。

我必須將內核參數添加rootdelay=90到. 然後系統啟動沒有問題。它甚至不需要很長時間(從 POST 到 Ubuntu 登入提示可能需要 30 秒)。對於這個問題,這似乎是一個鮮為人知/很少有記錄的解決方法。linux /vmlinuz...grub.cfg

相關內容