หาคนแก้ grub centos5 คะ หน้างานอยู่ระยอง

แบบว่า grub หายคะ แก้มาสามวันแล้ว ใช้แผ่น live cd ก็มิได้นำพา รึอาจจะเพราะมีความรู้น้อยเกินไป ตอนนี้เดือดร้อนเหมือนกันเพราะเป็นเครื่อง server ลูกค้า ท่านใดรับงาน pm มาด้วยจ้า รบกวนแจ้งราคาด้วยจ้า

http://wiki.centos.org/TipsAndTricks/ReinstallGRUB

ลองดูอีกซักรอบตามข้างบนครับ

ที่สำคัญคือต้องรู้ว่า partition / ชื่ออะไร
ลองเรียก e2label /dev/sda1 ไล่ไปจนเจอ /

/dev/sda1 = อยู่ที่ /boot
/dev/sda2 = อยู่ที่ /
ค่ะ

ตอนนี้มันบอกว่า

mount: could not find filesystem ‘/dev/root’ setuproot: moving /dev failed: No such file or directory setuproot: error mounting /proc: No such file or directory setuproot: error mounting /sys: No such file or directory switchroot: mount failed: No such file or directory Kernel panic - not syncing: Attempted to kill init!

ถ้า grub หายนี่เครื่องจะไม่ boot เลยนะครับ
แต่ถ้า boot ไปแล้ว error น่าจะเป็นปัญหาที่ filesystem มากกว่าครับ

error ข้างบนนี่เป็นตอน boot หรือ error จากตอนติดตั้ง grub ครับ
ลองติดตั้งแบบ manual เองเลย

grub
root (hd0,1)
setup (hd0)
exit

ลองติดตั้งแล้วค่ะ ใช้ rescue ค่ะ
แล้งลอง reboot อาการเดิมเลยค่ะ

ผ่านขั้นตอนของ grub ไปแล้วค่ะ error นี้ค่ะ

ใน grub config ชี้ root partition ผิดครับ

ค่ะ ต้องติดตั้ง grub ใช่ไหมค่ะ โดยใช้ rescue ใช่ไหมค่ะ

  • ไม่ต้องติดตั้งใหม่ครับ
  • ใช้ rescue เข้าไปแก้ไฟล์ /boot/grub/grub.conf ชี้ partition ให้ถูกก็น่าจะบูตติดแล้วคัรบ

ตอนนี้ grub.conf
ro root=LABEL=/ อะค่ะ

/dev/sda1 = /boot
/dev/sda2 = /

ไม่ทราบว่าต้องเปลี่ยน ตรงไหนค่ะ

แก้ root=LABEL=/ เป็น root=/dev/sda2

ตออนี้
Grub> find /grub/stage1
hd(0,1)
hd(0,6)

ลบ ออกด้วยไหมค่ะ ให้มันไปที่ hd0 หรือป่าวค่ะ

ทำไปทีละอย่างครับ แล้วลองดู ถ้าไม่ได้จะได้รู้ว่าแก้อะไรแล้วไม่มีผล

ไม่ใช่ทำทีเดียวสิบอย่างมันจะไปรู้มั้ยว่าที่แก้ไปตัวไหนส่งผลกับอะไร

ลองเปลี่ยนแล้วค่ะ อาการเดิมค่ะ

ขอดูไฟล์ boot/grub/grub.conf หน่อยครับ

grub.conf generated by anaconda

Note that you do not have to rerun grub after making changes to this file

NOTICE: You have a /boot partition. This means that

all kernel and initrd paths are relative to /boot/, eg.

root (hd0,0)

kernel /vmlinuz-version ro root=/dev/sda2

initrd /initrd-version.img

#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/sda2
initrd /initrd-2.6.18-164.el5.img

ไม่รู้ว่าเกี่ยวกับ Kernel หรือป่าวค่ะ ถ้าจะ complie kernel ใหม่ ได้ไหมค่ะ
ปล ทำยังไง ช่วยแน่ะนำได้ไหมค่ะ

e2label ออกมาได้ว่า /dev/sda2 คือ / ก็แปลว่า label ไม่ได้หายไปใหน การแก้ root=LABEL=/ ไปเป็น root=/dev/sda2 ก็มีค่าเท่าเดิม แต่ก็ช่วยให้แน่ใจได้มากขึ้นว่าไม่มี LABEL / ซ้ำกันหลายอัน

หลังจาก boot จากแผ่นด้วย linux rescue แล้ว มันเจอ partiton linux และ mount ให้ใน /mnt/sysimage ใช่มั้ยครับ
ลอง cd /mnt/sysimage
แล้ว ls -al ออกมาดูว่ามี folder อะไรบ้าง มีไฟล์หายหรือเปล่า

ขอดู fdisk -l กับ cat /mnt/sysimage/etc/fstab หน่อยครับ