Header Ads

Grub Rescue : Repair, Restore Ubuntu | Kali Linux Grub Bootloader using Live CD



Are you facing any of the following Problems-

1. Seeing nothing but the grub rescue prompt.


2. Grub Menu not detecting Windows Os.




3. There is no Grub Menu directly Windows OS starting.



If you are facing any of stated problem then this post is for you. Did Windows mess up your Master Boot Record? Doing Partitioning for resizing or dual booting Ubuntu/Kali, GRUB 2 got you down? Let's get started, resolving this problem using Ubuntu / Kali Linux live C.D.

How this Problem arises ?

If we talk about most of the cases, we install windows after Ubuntu installation. Ubuntu or any Linux OS uses grub boot-loader to boot and installing windows over Linux overrides Grub boot-loader with windows boot-loader, due to which at startup windows boot automatically.

Let's Resolve it out !!



Well the solution is pretty simple, all you need is ISO file of any Debian based O.S like Ubuntu, Elementary OS, Kali Linux & need to follow step by step instructions given below:

Steps to Follow :

1) Download Win 32 disk imager and make bootable pendrive of Ubuntu/Kali Linux

Download Ubuntu ISO

- Download win32 DiskImager

- Make a bootable USB of previously installed Linux using its ISO image




2) Now select Live CD, Open Terminal & type the following commands :


root@kali:~# blkid #use this command for checking name of ext4 partition in which previous linux installed
root@kali:~# sudo mount /dev/sdaX /mnt 
 replace X with your drive number on which Ubuntu | Kali (Linux OS) Installed
Installing grub needs access of some directories, so we need to bind them one by one using command line for detecting previously installed operating system.

root@kali:~# sudo mount --bind /dev /mnt/dev && 
> sudo mount --bind /dev/pts /mnt/dev/pts && 
> sudo mount --bind /proc /mnt/proc &&
> sudo mount --bind /sys /mnt/sys 

Now we are done with binding of all required directories, Let's move to chroot.

root@kali:~# sudo chroot /mnt #here symbol changes from root@kali:~# to root@kali:/# which means we have change our apparent root user.
Now, we came to our main part where we need to install, check and update grub .

Give below command uses sdX, where X denotes drive letter (usually a) but sometime changes. So, use blkid command to check your driver letter.

root@kali:/# grub-install /dev/sda 
root@kali:/# grub-install --recheck /dev/sda
root@kali:/# update-grub     

so, here we are ended with installing checking and updating grub. Now it's time to exit all mount directories using umount command.



root@kali:~# exit && 
> sudo umount /mnt/sys &&
> sudo umount /mnt/proc &&
> sudo umount /mnt/dev/pts &&
> sudo umount /mnt/dev &&
> sudo umount /mnt                       
                     

That's it let's restart your system using graphic restart or in terminal type init 6 and  remove the removable media, finally we have resolved our Grub boot-loader issue.
If facing any issue further comment out, i will try to sort it out as soon as possible.

4 comments:

  1. Nice post thanks a lot

    ReplyDelete
  2. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... www.repairloader.com

    ReplyDelete

Powered by Blogger.