LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub Install (https://www.linuxquestions.org/questions/linux-newbie-8/grub-install-576383/)

subaruwrx 08-11-2007 12:33 PM

Grub Install
 
Hi,

Previously, I have a dual boot of WinXP and Ubuntu using Grub.

However, I did a fixmbr using the winxp disk and my grub is gone and I can't access my ubuntu now. What should I do to install the grub without deleting my ubuntu partition?

Thanks.

mdg 08-11-2007 01:57 PM

Boot from a live cd /rescue disk. At the prompt type:

Code:

root (hd0,0)
point it to wherever your /boot/grub folder is. Then type:

Code:

setup (hd0)
to install to MBR, followed by

Code:

exit
Reboot without cd

subaruwrx 08-11-2007 10:13 PM

Quote:

Originally Posted by mdg
Boot from a live cd /rescue disk. At the prompt type:

Code:

root (hd0,0)
point it to wherever your /boot/grub folder is. Then type:

Code:

setup (hd0)
to install to MBR, followed by

Code:

exit
Reboot without cd

Hi,

My root is installed to sda6 of my one and only sata hdd. So it should be (hd0,5)?

However, after I typed root (hd0,5), it says syntax error near unexpected token 'hd0,5'

P.S I am booting from Ubuntu Live CD using its Terminal to execute the commands.

pixellany 08-11-2007 10:19 PM

Those commands have to be entered from a GRUB prompt. After booting, open a terminal and type:

grub ##starts the GRUB shell
root (hd0,5) ##your assumption was correct---- hda6 in Bashese = hd0,5 in Grubese
setup (hd0)

subaruwrx 08-11-2007 10:29 PM

Quote:

Originally Posted by pixellany
Those commands have to be entered from a GRUB prompt. After booting, open a terminal and type:

grub ##starts the GRUB shell
root (hd0,5) ##your assumption was correct---- hda6 in Bashese = hd0,5 in Grubese
setup (hd0)

Hi I got an error after typing "root (hd0,5)", saying "Selected disk does not exist"

syg00 08-11-2007 10:54 PM

Huh ...
Just type in "root (" and hit the <tab> key - it should list all the valid disks it finds.
What do you get ???. As a matter of interest, you can also use <tab> after the comma to get a list of known partitions.

subaruwrx 08-11-2007 11:43 PM

Quote:

Originally Posted by syg00
Huh ...
Just type in "root (" and hit the <tab> key - it should list all the valid disks it finds.
What do you get ???. As a matter of interest, you can also use <tab> after the comma to get a list of known partitions.

hmm..... after I typed in "root (" and hit the <tab> key, no list is being displayed. And if I typed in "root (hd0," <tab>, it says "Selected disk does not exist".

Ubuntu did not recognise my hdd?

However, I went back to bash, typed sudo fdisk -l, it did manage to list all the partitions correctly.

Latest Update: I did not "sudo grub" in the 1st place. It works now :D


All times are GMT -5. The time now is 08:31 AM.