Saturday 12 September 2015

[solved]Grub not opening on startup after formating a drive with windows 'or' Reparing of Grub without any software or internet [only with terminal] | Abhishek Singh

hey guys !!!
       many of you have face a problem that if you formate any drive with windows after installation of linux in any drive then grub doesn't start on startup..

This is because windows boot loader has replace the grub and also it doesn't like to show the list of any Linux OS installed on your machine.
so, now we gonna repair it.
you need any installation media of Linux mint, Ubuntu or Kali Linux.
so create a bootable usb or bring a CD from any of your friend (you can use your also, obviously ;])

now run that OS live (I'm using linux mint in my case!!!)

now open the terminal and type following command

sudo mount  /dev/sdXY /mnt

where X is usually a and Y is any integer..



for checking this just open menu and search for 'Disk' now find the Ext4 partition and see the address and value of X and Y. see the image below

see the 2nd line below the volumes figure.
so mine in "sda6" 
now type in the terminal

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

then type 

sudo chroot /mnt

now,

grub-install /dev/sdX [X=a in my case]
grub-install --recheck /dev/sdX
update-grub

now done.. and we just have to unmount all those partition. so,
type

exit &&
sudo unmount /mnt/sys &&
sudo unmount /mnt/proc &&
sudo unmount /mnt/dev/pts &&
sudo unmount /mnt/dev &&
sudo unmount /mnt

now hit <enter>



all done. congratulations you have sucessfully repaired your grub.

see you all with new problems and their solutions.
Happy coding !!! ;]

1 comment: