November 26, 2009
昨天晚上使用 Ubuntu 時,系統提示有百餘個更新/百餘MB要下載,想說今天早上到公司再來更新,沒想到早上更新後就進不了 Ubuntu 了 
原本以為是在更新的過程中,我中止了「linux-image-2.6.31-15-generic」核心套件的更新,導玫開機異常,後來由 google 查 after update ubuntu 9.10 sh:grub 找到一堆人遇到相同的問題,而這個問題只有使用 Wubi 安裝 Ubuntu 同時又更新了系統才會發生。
開始試著解,參考了以下兩篇,總算讓我進入 Ubuntu:
drs305 回覆的 http://ubuntuforums.org/showthread.php?p=8385754
冷月X 發表的 http://forum.ubuntu.org.cn/viewtopic.php?f=139&t=239982
我整理我可以手動開機的步驟如下:
sh:grub> insmod ntfs
sh:grub> set root=(hd0,5)
sh:grub> loopback loop0 /ubuntu/disks/root.disk
sh:grub> set root=(loop0)
sh:grub> linux /boot/vmlinuz-2.6.31-14-generic-pae root=/dev/sda5 loop=/ubuntu/disks/root.disk ro
sh:grub> initrd /boot/initrd.img-2.6.31-14-generic-pae
sh:grub> boot
其中 5 是我安裝 wubi/Ubuntu 的位置是在硬碟的第 5 分割,此部分可能因人而異,可以參考冷月X 的那一篇,用 ls (hd0,x)/ 的指令,來找出您的 ubuntu 是安裝在那一個分割。如果您是安裝在第二顆硬碟,那可能要用 ls (hd1,x)/ 的指令去找。
另外,那個 -pae 是我為了使 4G 的記憶體都用上,所以安裝了 PAE 套件。如果您沒安裝 PAE 套件,那就不用輸入 -pae 。
參考上述兩篇提到成功進入 Ubuntu 後,執行 sudo update-grub 或 sudo update-grub2 指令,再重開機即可解決問題。但是,我重開機仍然是有問題,還是得手動輸入一堆指令才能進入
在開機時會顥示一下 NO WUBILDR 的訊息,我再 google 一下並沒有更好的方法,有些人提到把 wubildr.* COPY 到 C:\ ,不過,還是一樣。
到官網 Bug Report 爬文...
Bug #477104 in grub (Ubuntu): “After 9.10 grub update can not boot into Wubi install”
Bug #477169 in Ubuntu: “Wubi/Karmic boot: kernel panic - not synching: VFS”
爬到眼花撩亂...
最後終於找到解法
參考:martin.pengpeng 回覆的
http://forum.ubuntu.org.cn/viewtopic.php?p=1584291#p1584291
我在手動進入 Ubuntu 後,由檔案瀏覽器先將 /boot/grub/grub.cfg 複製,再到
/host/ubuntu/install/ 目錄建立 boot 目錄,進去到
/host/ubuntu/install/boot/ 目錄建立 grub 目錄,進去到
/host/ubuntu/install/boot/grub/ 目錄,將剛才複製的 grub.cfg 貼上。也就是
/boot/grub/grub.cfg COPY 到 /host/ubuntu/install/boot/grub/grub.cfg
再重開機,Ubuntu 的開機選單就正常囉
/host/ 目錄是安裝 Wubi 時選擇的磁碟,Wubi 把 Ubuntu 就安裝在 /host/ubuntu/ 目錄內。
我看了一下 /host/ubuntu/winboot/wubildr.cfg 才知道為什麼上述的解法是正確的:
此外,我在順利重開後,再次更新 linux-image-2.6.31-15-generic 及 linux-image-2.6.31-15-generic-pae 兩個套件,更新重開後,還是無法選擇用它們開機,看來,暫時還是使用舊的 linux-image-2.6.31-14-generic-pae 開機囉

原本以為是在更新的過程中,我中止了「linux-image-2.6.31-15-generic」核心套件的更新,導玫開機異常,後來由 google 查 after update ubuntu 9.10 sh:grub 找到一堆人遇到相同的問題,而這個問題只有使用 Wubi 安裝 Ubuntu 同時又更新了系統才會發生。
開始試著解,參考了以下兩篇,總算讓我進入 Ubuntu:
drs305 回覆的 http://ubuntuforums.org/showthread.php?p=8385754
冷月X 發表的 http://forum.ubuntu.org.cn/viewtopic.php?f=139&t=239982
我整理我可以手動開機的步驟如下:
sh:grub> insmod ntfs
sh:grub> set root=(hd0,5)
sh:grub> loopback loop0 /ubuntu/disks/root.disk
sh:grub> set root=(loop0)
sh:grub> linux /boot/vmlinuz-2.6.31-14-generic-pae root=/dev/sda5 loop=/ubuntu/disks/root.disk ro
sh:grub> initrd /boot/initrd.img-2.6.31-14-generic-pae
sh:grub> boot
其中 5 是我安裝 wubi/Ubuntu 的位置是在硬碟的第 5 分割,此部分可能因人而異,可以參考冷月X 的那一篇,用 ls (hd0,x)/ 的指令,來找出您的 ubuntu 是安裝在那一個分割。如果您是安裝在第二顆硬碟,那可能要用 ls (hd1,x)/ 的指令去找。
另外,那個 -pae 是我為了使 4G 的記憶體都用上,所以安裝了 PAE 套件。如果您沒安裝 PAE 套件,那就不用輸入 -pae 。
參考上述兩篇提到成功進入 Ubuntu 後,執行 sudo update-grub 或 sudo update-grub2 指令,再重開機即可解決問題。但是,我重開機仍然是有問題,還是得手動輸入一堆指令才能進入

在開機時會顥示一下 NO WUBILDR 的訊息,我再 google 一下並沒有更好的方法,有些人提到把 wubildr.* COPY 到 C:\ ,不過,還是一樣。
到官網 Bug Report 爬文...
Bug #477104 in grub (Ubuntu): “After 9.10 grub update can not boot into Wubi install”
Bug #477169 in Ubuntu: “Wubi/Karmic boot: kernel panic - not synching: VFS”
爬到眼花撩亂...
最後終於找到解法
參考:martin.pengpeng 回覆的 http://forum.ubuntu.org.cn/viewtopic.php?p=1584291#p1584291
我在手動進入 Ubuntu 後,由檔案瀏覽器先將 /boot/grub/grub.cfg 複製,再到
/host/ubuntu/install/ 目錄建立 boot 目錄,進去到
/host/ubuntu/install/boot/ 目錄建立 grub 目錄,進去到
/host/ubuntu/install/boot/grub/ 目錄,將剛才複製的 grub.cfg 貼上。也就是
/boot/grub/grub.cfg COPY 到 /host/ubuntu/install/boot/grub/grub.cfg
再重開機,Ubuntu 的開機選單就正常囉

/host/ 目錄是安裝 Wubi 時選擇的磁碟,Wubi 把 Ubuntu 就安裝在 /host/ubuntu/ 目錄內。
我看了一下 /host/ubuntu/winboot/wubildr.cfg 才知道為什麼上述的解法是正確的:
set show_panic_message=true
if search -s -f -n /ubuntu/install/boot/grub/grub.cfg; then
if configfile /ubuntu/install/boot/grub/grub.cfg; then
set show_panic_message=false
fi
else
if search -s -f -n /ubuntu/disks/root.disk; then
if loopback loop0 /ubuntu/disks/root.disk; then
set root=(loop0)
if search --set=loop -f -n /boot/grub/grub.cfg; then
if configfile /boot/grub/grub.cfg; then
set show_panic_message=false
fi
fi
fi
else
if search -s -f -n /grub.cfg; then
if configfile /grub.cfg; then
set show_panic_message=false
fi
fi
fi
fi
if [ ${show_panic_message} = true ]; then
echo "It is not possible to boot from the Ubuntu image."
echo "Please verify that the Ubuntu installation was not removed."
echo "If that is not the case, please check that the Windows filesystem"
echo "is not corrupted: reboot into Windows and run: chkdsk /r"
echo "Then try again."
fi
由以上的資料看來,wubildr 本來就是會去找 /ubuntu/install/boot/grub/grub.cfg ,如果找不到,就會先掛載 /ubuntu/disks/root.disk 再去找掛載內部的 /boot/grub/grub.cfg,應該是更新系統後,此部分的掛載及讀取變得有問題,使得開機選單不會產生,導致無法順利開機。此外,我在順利重開後,再次更新 linux-image-2.6.31-15-generic 及 linux-image-2.6.31-15-generic-pae 兩個套件,更新重開後,還是無法選擇用它們開機,看來,暫時還是使用舊的 linux-image-2.6.31-14-generic-pae 開機囉



















