Benner Friends

Sunday, February 10, 2013

Cara Mengembalikan Grub di BakcTrack dan Ubuntu

Udah lama nich gak mosting di blog ini...
karena banyaknya permintaan cara mengembalikan grub di kampus, saya coba post dech semoga temen-temen kampus bisa ngerjain sendiri linux nya gak harus minta tolong slalu...
langsung aja, nich dia cara nya cikidot..


1. Nyalakan PC/laptop dan booting dari LiveCD Ubuntu atau flashdisk (yang sudah terisi OS Ubuntu).
2. Masukkan LiveCD Ubuntu ke dalam CD-ROM (atau flashdisk, tergantung mana yang ingin digunakan).
3. Pilih Try Ubuntu without any changes to your computer. Tunggu sampai Ubuntu tampil dengan sempurna.
4. Setelah berhasil masuk ke Ubuntu, buka terminal (klik Applications > Accessories > Terminal, atau tekan kombinasi tombol Ctrl+Alt+F2).
5. Ketik sudo fdisk -l untuk melihat partisi yang ada. Hasilnya muncul tulisan seperti di bawah ini:


Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003d663

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          13      102400    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2              13        5100    40857600    7  HPFS/NTFS
/dev/sda3            5100       22753   141796352    7  HPFS/NTFS
/dev/sda4           22753       30402    61440001    5  Extended
/dev/sda5           22753       23773     8192000   82  Linux swap / Solaris
/dev/sda6           23773       28636    39061504   83  Linux
/dev/sda7   *       28636       28700      512000   83  Linux
/dev/sda8           29079       30402    10622976   83  Linux




6. Sekarang ketik sudo mount -t ext4 /dev/sda6 /mnt/. CATATAN: sda6 adalah nama partisi Linux di komputer saya. Lihat tulisan yang dicetak tebal pada langkah nomor 5 di atas. Anda bisa menggantinya sesuai dengan nama partisi Linux di komputer Anda.
7. Ketik sudo mount -t proc proc /mnt/proc/
8. Ketik sudo mount -t sysfs sys /mnt/sys/
9. Ketik sudo mount -o bind /dev/ /mnt/dev/
10. Ketik sudo chroot /mnt/ /bin/bash
11. Ketik grub-install /dev/sda. Hasilnya muncul tulisan seperti di bawah ini:

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
(hd1) /dev/sdb
12. Ketik grub-install /dev/sda6. Hasilnya muncul pesan seperti ini:

grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea.
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged.
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
(hd1) /dev/sdb
13. UPDATE (20 Nov 2009): ketik update-grub. Hasilnya seperti di bawah ini:

Generating grub.cfg …
Found linux image: /boot/vmlinuz-2.6.31-14-generic
Found initrd image: /boot/initrd.img-2.6.31-14-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Microsoft Windows XP Professional on /dev/sda1
done

PS: Tip ini penting untuk mencegah kasus Windows yang tidak bisa booting dan selalu muncul pesan error: no such device, meski tampil (dan bisa dipilih) pada menu bootloader. Lihat posting soal error: no such device selengkapnya.
14. Sekarang ketik reboot untuk merestart komputer. Hasilnya, bootloader akan kembali seperti semula.
15. Jangan lupa mengeluarkan LiveCD Ubuntu atau Flashdisk (berisi OS Ubuntu) yang dipakai untuk booting tadi. Jika tidak, komputer akan booting lagi dari CD/Flashdisk.

nah setelah di reboot kadang windows belum muncul. tenang saja, masuk kembali ke linux kalian, (berdasar yang saya alami) lalu buka terminal di Linux kemudian ketik perintah di terminal

update-grub

lalu akan muncul update grub kalian. tutup terminal, reboot kembali komputer Anda dan di grub pilihan akan muncul Windows.

Selamat mencoba

1 comment: