Restoring Linux boot (Dual Boot Saga)

Dual Boot saga episode 2
After I installed Windows. I have lost Linux in the boot menu, in fact there wasn't a boot menu at all!
As soon I boot the computer Windows would come up and take the boot from there?!




I wanted to have Windows, not for Windows to be all I have!!
I had to restore booting to Linux, not only I liked it so much, my data and programs were there (Windows can't "see" the Linux partition).
At first I tried installing BCD Boot to create a boot menu, it failed on a daily biases for me!
I had to try a better solution, and what better solution that the Linux terminal? <3
I booted to Linux from a live disk (you can create one by following the steps in here).
After it boots go into the terminal and enter the following command:

Terminal interface

sudo fdisk -l
This command will show you all the partitions on your HDD, you have to know which partition your Linux distro is installed on (Gparted can be a great help in that).

Use gparted to see where is Linux installed


and enter this command:



sudo mount /dev/sda1 /mnt
then this command:


sudo mount --bind /dev /mnt/dev
then this command


sudo chroot /mnt
then this command

grub-install /dev/sda 
then this command
update-grub 
If the computer boots directly into Ubuntu (or whatever Linux distro you have)
go to the terminal and enter:


sudo update-grub  
Finally reboot and you will have the grub menu with Both Linux and Windows! 

The purpose of these commands is to install Grub (The boot manager) so you can dual boot easily from the menu. 
If you want to customize grub for example the names of the systems and the list order you need to download Grub Customizer. I think I'll post about it sometime later :)

Comments

  1. Rule of the thumb is to install Windows first and Linux Some opensource boot managers can be installed from within Windows and save one's sanity

    ReplyDelete
    Replies
    1. Thanks GM for the insight. That would have been easier!

      Delete

Post a Comment

شاركني برأيك في التعليقات. لا تقرأ وترحل!!