Thursday, June 03, 2010

Cara memperbaiki GRUB yang hilang/rusak (pada Ubuntu)


First, insert your Ubuntu CD into your computer and restart it, making sure
to have your computer start the operating system that is on the CD itself.
Next, choose your language and select Try Ubuntu.
Wait while the software loads. You will need to type some code to restore
your bootloader. On the Applications menu, click Accessories, and then click
the Terminal item. Enter the following:


$ sudo fdisk -l


Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device______Boot___Start________End________Blocks____Id_____System
/dev/sda1____________1________1224________64228+___83_____Linux
/dev/sda2_____*____1225_______2440______9767520____a5____Windows
/dev/sda3__________2441______14593_____97618972+___5____ Extended
/dev/sda4_________14532______14593_______498015____82___Linux swap

Partition table entries are not in disk order

This output means that your system (Linux, on whit Ubuntu is based)
is installed on device /dev/sda1, but your computer is booting to /dev/sda2
(where Windows is located). We need to rectify this by telling the computer
to boot to the Linux device instead.
To do this, first create a place to manipulate your Ubuntu installation:


$ sudo mkdir /media/root

Next, link your Ubuntu installation and this new folder:


$ sudo mount /dev/sda1 /media/root

If you’ve done this correctly, then you should see the following:


$ ls /media/root
bin dev home lib mnt root srv usr
boot etc initrd lib64 opt sbin sys var
cdrom initrd.img media proc selinux tmp vmlinuz

Now, you can reinstall :


$ sudo grub-install --root-directory=/media/root /dev/sda
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script grub-install.
(hd0) /dev/sda

Finally, remove the Ubuntu disc from your CD-ROM drive, reboot your
computer, and enjoy your Ubuntu system once again.


Disadur dari Getting Started with Ubuntu 10.04 oleh The Ubuntu Manual Team
credit goes to Cndr Agslm
for the great tutorial :)

No comments: