PDA

View Full Version : แก้ grub ให้กลับคืนหลังลง Windows ใหม่



DeUteRoNx
30-01-2009, 01:41 PM
[hide=2]

ในกรณีที่ลง 2 os ในเครื่องเดียว หลังจากที่ลง Windows ใหม่ จะไม่มี grub ขึ้นมาให้เลือกเข้า Ubuntu ให้แก้ดังนี้

* 1. boot เครื่องด้วย Ubuntu Live-CD
* 2. เปิด Terminal


Applications --> Accessories --> Terminal

* 3. ตรวจก่อนว่า Ubuntu เราอยู่ที่ไหนด้วย


sudo fdisk -l


สมมติว่า Ubuntu อยู่ที่ /dev/sda2 (ให้จำที่อยู่ Linux ไม่ใช่ของ Linux swap นะ)

แล้วโค้ดดังนี้


cd /

sudo -s -H


mount Ubuntu ที่ /dev/sda2 ถ้าอยู่ที่อื่นก็เปลี่ยน /dev/sda2 เป็น /dev/sdaXX


[code]
mount -t ext3 /dev/sda2 /mnt

mount -t proc proc /mnt/proc

mount -t sysfs sys /mnt/sys

mount -o bind /dev /mnt/dev

chroot /mnt