LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   can't get grub to boot ubuntu (https://www.linuxquestions.org/questions/linux-general-1/cant-get-grub-to-boot-ubuntu-639779/)

TechnoJunky 05-04-2008 07:57 AM

can't get grub to boot ubuntu
 
My computer has 2 hard drives, an IDE (sdb), which the bios recognizes and boots to and has Windows (ntfs). I have a Promise Sata card which gives me sata capabilities for my Linux drive (sda). Previously I had installed Fedora on it, then changed to Ubuntu (without issue). While Ubuntu was on it, I repartitioned it so that it would have a / (sda1) partition and a /home (sda2) partition. Still everything was fine. The other day I decided to do a new install of Ubuntu 8.04. After the install all I got was a grub> prompt, no menu. I tried reinstalling 8.04, no success, I tried 7.10, no success. I can however install Fedora 7 without any trouble. I went to the Ubuntu forums to find a resolution but nothing they suggest works.

I tried booting to a live CD and typing sudo grub, find /boot/grub/stage1, grub> root (hd0,1), grub> setup (hd0). Everything looked like it worked, but when rebooting, I still only get the grub prompt.

My fedora grub menu states that /boot is on hd1, but when I try the above info with hd1, it says that it can't mount it.

I tried grub-install /dev/sda1, this gives an error - Could not find device for /boot: Not found or not a block device.

bigrigdriver 05-04-2008 08:27 AM

Quote:

My fedora grub menu states that /boot is on hd1, but when I try the above info with hd1, it says that it can't mount it.
You should read that Fedora grub menu again. There is something missing in hd1. It should he hda1, or hdb1, or something similar.
Quote:

I tried grub-install /dev/sda1, this gives an error - Could not find device for /boot: Not found or not a block device.
That would install grub to the boot sector of the first partition, and not to the MBR. Try 'grub-install /dev/sda' to write grub first stage to the MBR.

TechnoJunky 05-04-2008 05:10 PM

Quote:

Originally Posted by bigrigdriver (Post 3142142)
That would install grub to the boot sector of the first partition, and not to the MBR. Try 'grub-install /dev/sda' to write grub first stage to the MBR.

This didn't work either. Here is the output:

ubuntu@ubuntu:~$ sudo grub-install /dev/sda
Probing devices to guess BIOS drives. This may take a long time.
Could not find device for /boot: Not found or not a block device.

Here's the menu.lst from Ubuntu:

title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-generic
root=UUID=673cf516-1191-4c26-bed5-994ed85613d2 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic
quiet

title Ubuntu 8.04, kernel 2.6.24-16-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-generic
root=UUID=673cf516-1191-4c26-bed5-994ed85613d2 ro single
initrd /boot/initrd.img-2.6.24-16-generic

title Ubuntu 8.04, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

And here's the one from Fedora:

default=1
timeout=5
splashimage=(hd1,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.21-1.3194.fc7)
root (hd1,0)
kernel /boot/vmlinuz-2.6.21-1.3194.fc7 ro root=LABEL=/ rhgb
quiet
initrd /boot/initrd-2.6.21-1.3194.fc7.img
title Other
rootnoverify (hd0,0)
chainloader +1

Larry Webb 05-04-2008 06:07 PM

Did you switch hd order or unhook one when installing the ubuntu 8.04? If when you boot and end up with the grub prompt it usually means the mbr lost the location of the menu.lst

TechnoJunky 05-04-2008 07:03 PM

No, I didn't make any hardware changes. All I do is boot to the CD and tell it to install to sda1. It works with Fedora but it doesn't with Ubuntu. In the past couple of days I've installed Ubuntu and then Fedora 4 or 5 times.

Could it be the Promise sata card? I'm not sure but when I first installed (successfully) ubuntu I may have used the on board sata connector (now broken). I had the promise card installed for an ntfs drive at the time for sure, but may not have been booting off of it until after installing the OS. Could it be that Grub isn't recognizing the hard drive attached to the card? When I do the grub-install /dev/sda, it keeps saying that it's probing the BIOS, but the drive doesn't show up in the bios, only the IDE one does.

Larry Webb 05-04-2008 08:15 PM

I will have to back out of this one, I had a promise ide card in a set a long time ago but I thought bios picked them up but may be wrong. If I remember grub boots from what it sees in bios. It does sound like that is your problem and the only help I might be able to give is boot a live cd and see if you can get a fdisk -ls from terminal and see if it sees your hds. I will try and search some for you and if I can come up with realavent information I will get back.

Larry Webb 05-04-2008 08:19 PM

Getting back you need to know how it sees the hds, your numbering on the hds in the menu.lst may be wrong. It may see them as hdd and hde or something of the nature and that would change the numbering in grub to (hd4,0) and (hd5,0)

TechnoJunky 05-04-2008 08:25 PM

After booting to the live CD, I'm able to mount the hard drive, and access the data.

Here's the fdisk -ls output


Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc6f5faeb

Device Boot Start End Blocks Id System
/dev/sda1 * 1 6475 52010406 83 Linux
/dev/sda2 6476 30025 189165375 83 Linux
/dev/sda3 30026 30401 3020220 82 Linux swap / Solaris

Disk /dev/sdc: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x86a57087

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 30515 245111706 7 HPFS/NTFS

BTW, I appreciate your help so far Larry, and understand if you can't come up with anything else. Hopefully someone else might have some info.

syg00 05-04-2008 09:46 PM

Can you type anything at the grub prompt ??? if so try "root (hd<tab>" (hit the tab key where I've got <tab>) and see what grub thinks the disk layout is. Then pick a disk number and a comma then tab again - like this "root (hd0,<tab>"
Do it for both disks if they are seen. Let's see the output.

If you can't type anything, the second disk is not known to the BIOS as a bootable device. But then that raises the question of what Fedora is doing - do you have a Fedora partition on the IDE ???.

TechnoJunky 05-06-2008 08:28 AM

Somewhere along the way I had reinstalled Ubuntu 7.10, maybe I tried 7.10 after the 8.04, not sure, but I had the same result. Last night I had reinstalled Fedora 7, then I installed 7.10, that worked. I have Ubuntu back on. I saw on the Fedora Forums that people had the same issue when upgrading to Fedora 9 beta. Maybe Ubuntu and Fedora are using a newer Grub that's having issues with multiple disks and Sata drives?

I'm going to have to put this issue on the back burner now. I have Ubuntu back on. Somehow during all the installs/reinstalls, I lost my NTFS data drive. I have to figure out how to get it back. I'm bummin'.

TechnoJunky 05-06-2008 08:35 AM

BTW, thank you everyone for all the tips and tricks and info!


All times are GMT -5. The time now is 03:26 AM.