LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Installed on 2nd internal hard drive and now Grub error? (https://www.linuxquestions.org/questions/linux-newbie-8/installed-on-2nd-internal-hard-drive-and-now-grub-error-562328/)

tedblais 06-16-2007 07:35 PM

Installed on 2nd internal hard drive and now Grub error?
 
Hi,

I have a Dell P4 with xp installed. I also have a 2nd internal drive that I just installed Ubuntu 7.04 onto. I installed the version for "Standard personal computer (x86 architecture, PentiumTM, CeleronTM, AthlonTM, SempronTM)"

What I was hoping for was to be able to boot off the drive of my choice. Admittedly though I had no idea how to make this happen, I was just hoping it would be obvious. It seemed to be running ok from the CD, but then I restarted the machine. Now all I get is :

Grub Loading Stage 1.5

Grub Loading, please wait

Error 21


No XP, No Linux.

Any suggestions?

Thank You Very Much!

Junior Hacker 06-16-2007 09:02 PM

The best way to install the boot loader during installation is to install it to the MBR of the drive set to boot in the bios which normally is the master drive, normally where Windows is installed. Then when the bios passes control to the drive set to boot in the bios after doing the P.O.S.T., grub presents a list of all OS's installed and you select the one you want to boot and it should boot up.
Type in a terminal: fdisk -l to get a good view of partition names.
If your Windows drive is /dev/sda and your Ubuntu is /dev/sdb, and Ubuntu /boot or / partition is /dev/sdb1, then you would enter these four commands in a terminal while running the CD:
Code:

sudo grub
root (hd1,0)
setup (hd0)
quit

The "grub" command puts you in a grub session, the "root" specifies where the /boot/grub/menu.lst is as this is the configuration file, grub starts counting from 0, so the second drive is (hd1) and first partition is 0, the setup tells grub to install stage one in the MBR of the first drive.

tedblais 06-16-2007 09:23 PM

Quote:

Originally Posted by Junior Hacker
The best way to install the boot loader during installation is to install it to the MBR of the drive set to boot in the bios which normally is the master drive, normally where Windows is installed. Then when the bios passes control to the drive set to boot in the bios after doing the P.O.S.T., grub presents a list of all OS's installed and you select the one you want to boot and it should boot up.
Type in a terminal: fdisk -l to get a good view of partition names.
If your Windows drive is /dev/sda and your Ubuntu is /dev/sdb, and Ubuntu /boot or / partition is /dev/sdb1, then you would enter these four commands in a terminal while running the CD:
Code:

sudo grub
root (hd1,0)
setup (hd0)
quit

The "grub" command puts you in a grub session, the "root" specifies where the /boot/grub/menu.lst is as this is the configuration file, grub starts counting from 0, so the second drive is (hd1) and first partition is 0, the setup tells grub to install stage one in the MBR of the first drive.

Thank you.

However you are a little over my head here. So I need to install a bootloader. Do I heve one or do I need one? Where can I find the right one for my setup?

Junior Hacker 06-16-2007 09:43 PM

Everything should be in place, just boot to the Live CD and issue the commands in a terminal. Error 21 means the disk specified does not exist, so not sure how you got that, it appears it cannot find it's configuration files.
If you're still a little iffy, boot into the live environment with the CD and type: fdisk -l and post the output here and I will tell you exactly which commands to issue to reinstall grub properly. If you get an error with the fdisk -l command, means you have to use sudo as such: sudo fdisk -l , and put in the admin. password.

syg00 06-16-2007 10:30 PM

@Junior, grub *is* in the MBR.
I suspect the disk order changed when the second disk was installed, but didn't affect anything because the MBR code area (of the second disk) was null.
Now it ain't.

@tedblais - try doing the "sudo fdisk -l" from the CD and post it here prior to attempting the fix.

Junior Hacker 06-16-2007 10:37 PM

Quote:

Originally Posted by syg00
@Junior, grub *is* in the MBR.

I'm well aware of that, otherwise grub would not have come up and produced an error. Would you like to take over?

syg00 06-16-2007 10:53 PM

Generally more input is better.
As you seem to feel threatened by that, I'll just watch.

tedblais 06-18-2007 10:36 PM

I re-installed Ubuntu (just to make sure I did it right and wiped that drive clean), then ran Junior Hacker's code, and then changed something in the BIOS setup ( I wish I could remember exactly what) from off to Auto and that seemed to to do the trick.


I really appreciate everyones help here. I will have many more questions here as I am having problems installing simple stuff (like a .wav player). I will post in a different topic about those.

Thanks!


All times are GMT -5. The time now is 02:57 PM.