ตอนนี้ผมใช้ Ubuntu 10.04 Lucid Lynx beta อยู่ ก็จะมีอัพเดทถี่ๆแทบทุกวัน เมื่อคืนอัพเดทมีอัพ kernel จาก 2.6.32-18-generic ไปเป็น 2.6.32-19-generic แต่ก็ยังไม่ได้ restart เครื่อง จะนอนแล้วก็ปิดเครื่องไป พอเมื่อเช้าเปิดมาเจอ
[ 58.593255 ] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
ทำอะไรไม่ได้เลย เพราะ default ของ grub2 ที่มากับ lucid มันไม่แสดง menu ให้เลือก มันเลือกบูตจาก kernel ตัวล่าสุดไปเลย
ทำอะไรไม่ได้ก็เลยต้องหาแผ่น Live CD มาบูต ดีมีแผ่น Suriyan ที่ได้จากงาน miniDebCamp ติดกระเป๋า ก็เลยบูตเข้าไปที่ Suriyan ตัว Suriyan เองพัฒนาต่อมาจาก 9.10 Karmic ก็เลยใช้ grub2 เหมือนกัน
ตอนแรกก็ค้นหาวิธีในเนต หายังไงก็ไม่เจอ ก็เลยคิดว่าจะลองบูตเข้าไปที่ kernel ตัวเก่า ก็เลยหาวิธีแก้ให้มันแสดง menu ตอนบูต ปัญหาคือมันเป็น grub2 ซึ่งเปลี่ยนวิธี config ไปจากเดิมอย่างสิ้นเชิง ของเก่าเคยแก้แค่ไฟล์ menu.lst แค่ไฟล์เดียว ตอนนี้เข้าไปก็ไม่เจอไฟล์ menu.lst แล้ว
ค้นไปค้นมาไปเจอ document ของมันที่ https://wiki.ubuntu.com/Grub2 บอกวิธีแก้ให้มันแสดงเมนูโดยไปแก้ที่ไฟล์ /etc/default/grub ให้คอมเม้นที่
#GRUB_HIDDEN_TIMEOUT=3
และ ปรับค่าจำนวนเวลาที่จะแสดง menu ที่
GRUB_TIMEOUT=XXX
เสร็จแล้วให้เรียกคำสั่ง update-grub
แต่ว่า เราใช้ Suriyan บูต ทำให้มันไม่มอง drive ที่เรา mount เป็น root (/) ต้องเปลี่ยนด้วยคำสั่ง chroot ก่อน
ด้านล่างของ document จะมีบอกวิธี chroot แต่ว่าก่อนจะ chroot จะทำการ –bind พวก /dev /proc และ /sys ก่อน ด้วยคำสั่ง ประมาณนี้
$ sudo mount --bind /dev /mnt/dev $ sudo mount --bind /proc /mnt/proc $ sudo mount --bind /sys /mnt/sys
ข้างหลังตรง /mnt/dev ก็คือชี้ไปที่ path ของรูทที่เรา mount ไว้ก่อน
หลังจากนั้น ใช้คำสั่ง
$ sudo chroot /mnt
เพื่อเปลี่ยน root directory โดย /mnt คือ path ของ drive อื่นที่ mount ไว้ หลังจากนั้นก็แก้ตามที่บอกข้างบน แล้ว reboot คราวนี้ก็จะเห็น menu แล้ว
สุดท้ายวิธีแก้ kernel panic ก็คือ บูตไป kernel เก่า แล้วไป apt-get remove ตัว kernel ใหม่ เสร็จแล้ว apt-get install ใหม่อีกที หายเลยทีนี้
โอเค!
โอเค!ครับ
อยากลองดูครับ
จะลองเอาไปทำตามดู
I love what you guys are usually up too. This kind of clever work and exposure!
Keep up the very good works guys I’ve you guys to blogroll.
I’m amazed, I must say. Seldom do I come across a blog that’s both equally educative and amusing, and without a doubt, you’ve
hit the nail on the head. The issue is something which too few
people are speaking intelligently about. I am
very happy that I stumbled across this in my hunt for something concerning this.
you’re truly a just right webmaster. The site loading pace is incredible.
It kind of feels that you’re doing any distinctive trick.
In addition, The contents are masterpiece. you have done a wonderful task in this topic!
Hello to every body, it’s my first pay a quick visit of this blog;
this blog contains amazing and really good data for
readers.