LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bringing back grub (https://www.linuxquestions.org/questions/linux-newbie-8/bringing-back-grub-4175457800/)

sniper8752 04-11-2013 10:43 AM

bringing back grub
 
I installed windows after installing linux. Grub no longer shows up. How do I get it back?

spiky0011 04-11-2013 11:23 AM

Hi

Boot the live cd mount your linux partition /mnt/sdax
X being the partition number

install grub
sudo grub-install --root-directory=/mnt/sdax dev/sda

programer 04-11-2013 12:57 PM

Quote:

Originally Posted by spiky0011 (Post 4929825)
Hi

Boot the live cd mount your linux partition /mnt/linux

install grub
sudo grub-install --root-directory=/mnt/linux dev/sda

This i had seen in some other forum , can you just replace the --root directory and write exactly what should be given there ? It will help newbie to understand better

sniper8752 04-11-2013 01:23 PM

So if I have windows installed on my first partition, and then for my extended partition, the partitions, /boot, /, etc., do I want to install it to the first one (NTFS) or to one of the linux partitions? I read that the mbr is located at position 0, so I wasn't sure if I install it on the windows partition, but I was afraid it would write over windows.

TroN-0074 04-11-2013 01:26 PM

Here is explained for Ubuntu OP hasn't mentioned what OS he is using ------> https://help.ubuntu.com/community/Gr...talling_GRUB_2

Quote:

forget this part

Boot from live CD or USB then open a terminal and type

Code:

sudo fdisk -l
Note: -l is lowcap L, no the number 1

You'll see a list of your drives and partitions, (like /dev/sda1. Make note of the partition you have your root for Linux)Here we will assume sda1 is the partition you have installed Linux
then do
Code:

sudo mkdir /mnt
Code:

sudo mount /dev/sda1 /mnt
Next do
Code:

sudo chroot /mnt


John VV 04-11-2013 02:38 PM

Quote:

I installed windows after installing linux. Grub no longer shows up. How do I get it back?
so you did not fallow the advice on almost every guide on dual booting
1) install windows
2) install linux
( grub will boot windows, windows will NOT boot linux )

you made a /boot partition
install grub there

then in the bios set THAT partition to boot first !
or using Gparted live cd
put the "boot flag" on that partition

programer 04-18-2013 04:04 AM

I tried all possible ways but it failed, and I had finally reloaded the OS and its working fine now.. Thanks for all the support provided.

sniper8752 04-19-2013 06:37 PM

Finally solved... did a complete re-install, but that did not work (of Linux). Then I followed this tutorial. I was mounting the sda# instead of just the sda partition.

Link: http://www.howtogeek.com/114884/how-...ntu-wont-boot/

programer 04-20-2013 10:32 AM

Same here, did a complete reinstall ( including Windows) it worked fine, unable to find what went wrong initially.


All times are GMT -5. The time now is 10:49 AM.