PDA

View Full Version : Grub failing to work



satimis
17th June 2006, 03:13 AM
Hi folks,

FedoraCore5_64

Grub on this box did not work ever since running "yum update" updating "kernel-2.6.16-1.2133_FC5" a few days ago. On starting the PC only with "GRUB" popup on a black screen without other messages. Typing does not work, keystroke without function. I have to run a boot floppy to start the box/PC.

# uname -a

Linux localhost.localdomain 2.6.16-1.2133_FC5 #1 SMP Tue Jun 6 00:51:53 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux

# rpm -qa kernel

kernel-2.6.16-1.2133_FC5
kernel-2.6.16-1.2122_FC5

The boot floppy was created on this box with
# grub
grub> root (hda0,0)
setup (fd0)


I tried to fix the problem with the boot floppy without success. Steps performed as follows;

# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1734 13823932+ 83 Linux
/dev/sda3 1735 3008 10233405 83 Linux
/dev/sda4 3009 9729 53986432+ 5 Extended
/dev/sda5 3009 3262 2040223+ 82 Linux swap / Solaris

HD - SATA interface
/boot on /dev/sda1


After starting the box/PC with the boot floppy

1)
On Konsole;
# grub

Probing devices to guess BIOS drives. This may take a long time.

GNU GRUB version 0.97 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub> root (hd0,0)

root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0,0)
setup (hd0,0)

Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0,0)"... failed (this is not fatal)
Running "embed /grub/e2fs_stage1_5 (hd0,0)"... failed (this is not fatal)
Running "install /grub/stage1 (hd0,0) /grub/stage2 p /grub/grub.conf "... succeeded
Done.

Exited grub and rebooted the box/PC. Still failed to boot the box/PC with only "GRUB" displayed on a black screen, no other messages. Keystroke did not work.


2)
On Konsole
# grub

Probing devices to guess BIOS drives. This may take a long time.

GNU GRUB version 0.97 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub> root (fd0)

root (fd0)
Filesystem type unknown, using whole disk
grub> setup (hd0,0)

setup (hd0,0)

Error 17: Cannot mount selected partition

Failed. Whether I need to mount the /boot partition (/dev/sda1) first before running "grub"? The HD is working. Would it make confusion resulting in re-installing the complete FC5_64.


Besides I can't mount the boot floppy, either as root or as user, to copy "grub" from it on /boot

$ cat /etc/fstab
...
....
/dev/fd0 /mnt/floppy auto noauto,owner,user,kudzu 0 0

However I can mount a floppy with .txt files on it only by running "mount /mnt/floppy"

It looks strange to me. Would the boot floppy only contain an image.

Please advise. TIA

B.R.
satimis

b_martinez
17th June 2006, 03:51 AM
at grub prompt type this in, and hit the 'ENTER' key after each line:

root (hd0,0)
kernel /boot/vmlinuz-2.6.16-1.2133_FC5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.16-1.2133_FC5.img

Have you tried to install grub to /dev/sda?
grub --install /dev/sda
root (sd0,0)
setup (sd0)
In this case the 'h' in (hd0) likely points to an IDE drive. According to your fdisk output, you installed to a SATA drive. [The 'sda' part.] Installing to sda will put grub into the MBR. If you do not want the GRUB bootloader in the MBR ,re-write the entries on the floppy to show 'sd*' rather than 'hd*'.
Hope you get this fixed.
Bill

satimis
17th June 2006, 04:09 AM
Hi b_martinez,

Tks for your advice.


Have you tried to install grub to /dev/sda?
grub --install /dev/sda
root (sd0,0)
setup (sd0)No. I only tried to get the problem fixed with the boot floppy.


In this case the 'h' in (hd0) likely points to an IDE drive. According to your fdisk output, you installed to a SATA drive. [The 'sda' part.] Installing to sda will put grub into the MBR. If you do not want the GRUB bootloader in the MBR ,re-write the entries on the floppy to show 'sd*' rather than 'hd*'.Please advise in more detail. TIA

During installing the box previously I created /boot partition for MBR. Whether after installing MBR on sda, / (root), I have to remove /boot partition Or leaving it there?

I'm prepared to make the SATA HD multi-boot for other Linux distro which I'll install latter on the ext partition. The later is not configured yet. Total capacity of the SATA HD is 80G. I think I only use about 25G.

On creating the boot floopy previously I used (hd0)

B.R.
satimis

b_martinez
17th June 2006, 04:57 AM
The /boot partition is good where it is, since you can use it to hold the bootloader of another operating system [i.e. Linux or one of the BSD's].

The part about the (hd0,0) is not correct. My apologies. I have 2 IDE and 2 SATA drives in my computer, and had to install the FC5 GRUB to /dev/sda. HOWEVER, this is taken directly from the /boot/grub/menu.lst on my computer

title Fedora Core
root (hd0,0)
kernel /boot/vmlinuz-2.6.16-1.2133_FC5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.16-1.2133_FC5.img

and it shows that root is on (hd0,0) although it is really /dev/sda1.
To install grub to /dev/sda get back to where you saw this

Probing devices to guess BIOS drives. This may take a long time.

GNU GRUB version 0.97 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub>

and type these lines in, followed by the "ENTER' key

grub --install /dev/sda
root (sd0,0)
setup (sd0)

This will set grub up in the mbr of the disk that FC5 is installed on. You should be able to boot from that. [ It will use the /boot partition to store the grub.conf
file.]
BEFORE you do this, I need to know if your motherboard has the option to select which hard drive to boot from. I use a MSI K8N NEO PLATINUM, and I can hit the F11 key to open a menu for choosing a boot device (hard drive, cd,DVD, usb,floppy, among others). If you can do this, try finding the hard drive listing for sda or /dev/sda or SATA M.1 or whatever your first SATA drive is known as . If this boots you up, you will need to go into the BIOS and change the hard drive boot order, just leave the floppy and CD as 1st and 2nd for emergencies.
Does this make sense to you , or am I babbling away? [saying crazy things?] It's been a LOOOOOOOOONG day.
Bill

satimis
17th June 2006, 05:38 AM
Hi Bill,

Tks for your advice.


BEFORE you do this, I need to know if your motherboard has the option to select which hard drive to boot from. I use a MSI K8N NEO PLATINUM, and I can hit the F11 key to open a menu for choosing a boot device (hard drive, cd,DVD, usb,floppy, among others). If you can do this, try finding the hard drive listing for sda or /dev/sda or SATA M.1 or whatever your first SATA drive is known as . If this boots you up, you will need to go into the BIOS and change the hard drive boot order, just leave the floppy and CD as 1st and 2nd for emergencies.My motherboard AUSU AN8-VM has boot option on HD selection, i.e.

1st boot - /floppy/cdrom/hd
2nd boot - /floppy/cdrom/hd
3rd boot - /floppy/cdrom/hd

Also on /hd you can choose which hd to boot.

B.R.
satimis