broken grub question

John McBride jmcbride at ccis.com
Thu Sep 2 03:22:37 UTC 2004


James Pifer wrote:

>I posted this to the redhat list, but there isn't much activity. I have
>a problem with grub on a redhat 9 machine that I'm hoping someone here
>might be able to help with. I have a Fedora system that appears to have
>the same problem. 
>  
>
Can you use the grub command line to setup your kernel and initrd 
images, then "boot"? I have to do this sometimes while I'm fighting a 
troublesome box. For example someone will put unsupported hw in a bix 
and mkinitrd will silently fail (no initrd in /boot). Once you 
understand the hd# syntax and the TAB completion for disks, partitions, 
paths and filenames, it's darn useful.

grub> root (<TAB>
...should give drive info.
grub> root (hd0,<TAB>
...should give partition info.
grub root (hd0,0)/<TAB>
...should show the files/directories in the drive's partition.
(This is from memory; pls. someone correct me if this is 
wrong--sometimes I have to use help and fiddle with it to remember).

This link helps me, too:
http://portal.suse.com/sdb/en/2002/09/fhassel_grub_overview.html

Also I sometimes use the CD "linux rescue" mode:
1) see whats mounted under /mnt/sysimage with "mount" (is it sane?)
2) check /mnt/sysimage/etc/fstab (is it sane?)
3) "e2label" to check the partition labels (are the boot and root paritions named properly?)
4) "chroot /mnt/sysimage", then play with "rpm" to remove/reinstall kernels, etc.
5) run the /sbin/grub-install command and see if it comes up clean.

Anyway, this is the general course I follow on a machine that won't boot. At work people open their boxes and add IDE or SCSI drives, reorder things, it gets messy. When they do this I often have to go futz with the BIOS boot order, or screw around with the SCSI card settings.

The above tools/operations/checks have always worked for me, in every case.

Here are the listings off my FC2 box:

[ boot]$ ls
config-2.6.5-1.358      initrd-2.6.8-1.521.img  vmlinuz-2.6.5-1.358
config-2.6.8-1.521      lost+found              vmlinuz-2.6.8-1.521
grub                    System.map-2.6.5-1.358
initrd-2.6.5-1.358.img  System.map-2.6.8-1.521

[ boot]$ ls grub/
device.map     ffs_stage1_5  menu.lst           splash.xpm.gz  vstafs_stage1_5
e2fs_stage1_5  grub.conf     minix_stage1_5     stage1         xfs_stage1_5
fat_stage1_5   jfs_stage1_5  reiserfs_stage1_5  stage2

I once had to reinstall grub to get all the "stage" files back. They went missing somehow.

---
John





More information about the users mailing list