[FrontPage] [TitleIndex] [WordIndex

This is a read-only archived version of wiki.centos.org

Troubleshooting GRUB Issues

If a system has issues with the GRUB configuration (possibly caused by incorrect changes to the the GRUB configuration file, installation of another OS, changes to device ordering due to hardware or BIOS changes, etc.) causing GRUB to be unable to find its configuration file, one may end up sitting at the grub boot prompt without a clue as to what to do next. The first step is usually to discover where the GRUB configuration files are located. The GRUB find command can help.

grub> find /grub/grub.conf
find /grub/grub.conf
 (hd0,2)
 (hd1,2)

This tells us that we have two /boot partitions, possibly due to use of software RAID or multiple OS installations. One is on the first hard disk third partition, the other is on the second hard disk third partition. To reinstall the GRUB configuration for the first instance to the MBR:

grub> root (hd0,2)
grub> setup (hd0)

If other Linux versions such as Ubuntu are installed, there may be a menu.lst file but no grub.conf for that installation, but as CentOS uses a symbolic link menu.lst pointing to grub.conf a find on menu.lst will work for either:

grub> find /grub/grub.conf
find /grub/grub.conf
 (hd0,0)
grub> find /grub/menu.lst
find /grub/menu.lst
 (hd0,0)
 (hd0,1)

This tells us that we have two /boot partitions, the first on the the first disk first partition, probably our CentOS, and another Linux /boot on the first disk second partition.

To see what is in grub.conf and menu.lst files use the GRUB cat command:

grub> cat (hd0,0)/grub/grub.conf
 ... contents of file listed ...
grub> cat (hd0,1)/grub/menu.lst
 ... contents of file listed ...

If nothing was found on the first try it may be that there is no /boot partition and grub is installed on the root partition. Try

grub> find /boot/grub/grub.conf
 (hd0,0)
 (hd1,4)

In this example there are again two GRUB installations. One on the first disk first partition, and the other on the second disk fifth partition - the first extended partition.

To restore the second instance and write the GRUB bootloader on the MBR of the first disk:

grub> root (hd1,4)
grub> setup (hd0)

If in doubt as to where the root partition is located one might try to find a file in /etc. For example:

grub> find /etc/fstab
 (hd0,1)

Thus we know our / is on the first disk second partition - /dev/sda2 for SCSI or SATA, or /dev/hda2 for PATA.

The GRUB shell has a lot more capabilities, and is thoroughly documented in the GRUB info files, accessible via "info grub".


Other GRUB articles:


This page created and maintained by PhilSchaffner. Other Wiki contributors are invited to make corrections, additions, or modifications.


2023-09-11 07:23