Rabu, 10 Februari 2010

mengembalikan grub

saya pernah suatu ketika menginstall ulang windows. dan karena saya memakai dual OS (windows xp dan ubuntu), grub menjadi hilang.ditengah kebingungan saya, saya lalu mencoba googling dengan kata kunci "restoring grub". dan ternyata caranya adalah sebagai berikut

  1. boot dengan live cd anda (dalam hal ini saya memakai ubuntu live cd karena saya pemakai ubuntu).untuk yang lain saya belom pernah. hehehhehehehe
  2. Masuk ke terminal.
  3. Ketik grub
  4. Ketik find /boot/grub/stage1 nanti akan keluar partisi yang ada grubnya. contoh (hd0,5) <--soalnya punya saya keluarnya itu.
  5. Ketik root (hd0,5). harap diingat bila misalnya pada waktu ngetik find /boot/grub/stage1 keluarnya (hd0,4) berarti ngetiknya root (hd0,4).
  6. Ketik setup (hd0). to install it on hd0, that is MBR of the first HD. alias nginstal di hd0 yang merupakan MBR dari HD pertama.
  7. Ketik quit
  8. Ketik reboot "now"
selesai dah... silahkan dicoba... hehehehehehhehe
mungkin bila belom berhasil maka harus edit lagi menu.lst. menu.lst ada di /boot/grub/menu.lst

ini menu.lst saya di bagian belakang sendiri
title Ubuntu 9.10, kernel 2.6.31-16-generic
uuid 4b61dc99-68dc-4c27-94b0-d813255188c5
kernel /boot/vmlinuz-2.6.31-16-generic root=UUID=4b61dc99-68dc-4c27-94b0-d813255188c5 ro quiet splash vga=786
initrd /boot/initrd.img-2.6.31-16-generic
quiet

title Ubuntu 9.10, kernel 2.6.31-16-generic (recovery mode)
uuid 4b61dc99-68dc-4c27-94b0-d813255188c5
kernel /boot/vmlinuz-2.6.31-16-generic root=UUID=4b61dc99-68dc-4c27-94b0-d813255188c5 ro single
initrd /boot/initrd.img-2.6.31-16-generic

title Other operating systems:
root
title Microsoft Windows 7 Ultimate
rootnoverify (hd0,0)
savedefault
makeactive
chainloader +1

kenapa windows ordernya saya taruh di belakang? karena saya cenderung lebih suka pakai ubuntunya. hehehehehhehe

untuk yang grub 2 (sorry dalam bahasa linggis. langsung copas dari http://www.ubuntugeek.com/how-to-restore-grub-boot-loader-after-installing-windows.html soalnya males ngetik lagi.)

Using Ubuntu 9.10 livecd

First you need to download Ubuntu from Ubuntu site

In this tutorial we are assuming the Ubuntu partition is sdc3,and /boot partition is sdc2

Note:- You need to replace sdc3,sdc2 with your partitions.You can check your partition table with fdisk -l

Now Boot up ubuntu from the livecd,open terminal from Applications menu -> Accessories -> Terminal and login as root using the following command

sudo -i

mount /dev/sdc3 /mnt

mount /dev/sdc2 /mnt/boot

grub-install --root-directory=/mnt/ /dev/sdc

If you are not having “grub.cfg” file,use following contents to recreate

mount --bind /proc /mnt/proc

mount --bind /dev /mnt/dev

mount --bind /sys /mnt/sys

chroot /mnt update-grub

umount /mnt/sys

umount /mnt/dev

umount /mnt/proc

exit

ataw pake yang ini (pengalaman ane sih yang ini malah bisa jalan. ini ane ambil dari http://techie-buzz.com/ubuntu/restore-grub-ubuntu-9-10-karmic-koala.html)
  • Boot from Ubuntu 9.10 or any Ubuntu 9.10 derivative live CD ( the CD from which you installed Ubuntu).

  • After the boot is complete, press alt+F2 to open a terminal.

  • Enter the command fdisk as
    sudo fdisk -l
    This lists all the partitions as shown.

  • Mount the drive marked as Linux under System ( the last column) using the command
    sudo mount “device” /mnt
    fdisk
    Replace “path” with the corresponding device ID under the Device Boot section. So, for the given screen-shot,
    my command will be
    sudo mount /dev/sda12 /mnt

  • After the mount is successful, install grub with the command
    sudo grub-install –root-directory=/mnt “path”

  • Unmount the drive with
    sudo unmount /mnt

bila ada salah2 kata maap ya.. CMIIW

Tidak ada komentar:

Posting Komentar

Blogger Tricks