Monday, August 8, 2011

Fixing Grub

This problem usually happens when you installed Linux then probably accidentally installed another OS in your PC... but the Linux partition is still there.. So the solution is very easy.

What do you need to have
1. Live CD Ubuntu/Live USB Ubuntu/or any type of Linux LIVE CD



Procedures:
1. Boot up your Live CD
2. Launch the terminal and type this
fdisk -l
3. It'll show something like this:



Note: These are the list of partitions in your PC. For this example.. My linux(Ubuntu) partition is: /dev/sda2


4. If you do not understand or unsure of which partition is your Linux.. You can use gparted but not all Linux Live CD have them but usually Ubuntu's Live CD have them. The procedure is still the same.. launch the terminal and type:
gparted
then it'll pop a window something like this:



5. Type these
sudo su
mount /dev/sdx# /mnt (gantikan x# dengan partition linux korang, Exp: /dev/sda2)
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
cp /etc/resolv.conf /mnt/etc/resolv.conf
chroot /mnt
grub-install --recheck /dev/sdx (gantikan x dengan partition linux korang , Exp: /dev/sda)
reboot
Plug out your Pendrive / Live CD

6. Now your Grub is okay but the Windows are hidden, Don't worry.. it can be fixed

7. Log into Linux again and type:
sudo su
update-grub2 

8. DONE..

Good Luck!


No comments:

Post a Comment