Help - Search - Members - Calendar
Full Version: How-To: Finding which bootloader is used
The Planet Forums > System Administration > HOWTOs
Err0r
Some of the current images of Redhat (specifically RHEL) used by ev1 have both bootloaders installed on the system. This makes it somewhat annoying when you are doing kernel upgrades as you have to modify both loader config or take a gamble.

Therefore, if you wish to find out which bootloader is used on the system, you will need to su to root.

As root, you need to run either of these commands:
dd if=/dev/hda bs=512 count=1 2>&1 | grep GRUB
or
dd if=/dev/hda bs=512 count=1 2>&1 | grep LILO

If the bootloader is found then it will say: Binary file (standard input) matches and this indicates this is the bootloader your system will use on startup.

This command will work on any of the redhat based systems.
henker
*IF* you have grub installed, an even easier solution to find out what the actual bootloader is, is:
/sbin/grubby --bootloader-probe

It will print out whether grub or lilo is in use. If it prints something else, you must have an extraordinary bootloader icon_smile.gif
Once you made sure you use grub, I'd recommend removing lilo by issuing
rpm -e lilo
The best solution of course was if the EV1 images included only ONE bootloader...
Michael
QUOTE (henker @ Mar 9 2004, 04:29 PM) *
*IF* you have grub installed, an even easier solution to find out what the actual bootloader is, is:
/sbin/grubby --bootloader-probe
It will print out whether grub or lilo is in use. If it prints something else, you must have an extraordinary bootloader icon_smile.gif
Once you made sure you use grub, I'd recommend removing lilo by issuing
rpm -e lilo
The best solution of course was if the EV1 images included only ONE bootloader...


I'm having some problems figuring out what to do with this box. It was admin'd by someone else at one point and I have no clue what they did. Ev1 won't touch it now though.. they said the kernel was corrupt?

I tried to install the latest kernel and got a grubby error:

root@host4 [/]# rpm -ivh kernel-2.4.21-51.EL.i686.rpm
Preparing... ########################################### [100%]
1:kernel ########################################### [100%]
stdin: is not a tty
stdin: is not a tty
stdin: is not a tty
grubby fatal error: unable to find a suitable template

I googled that error and it said something about a bug with lilo/grub. So then I went to double check which boot loader was being used (found this post) and ran the commands.

root@host4 [/]# dd if=/dev/hda bs=512 count=1 2>&1 | grep GRUB
Binary file (standard input) matches
root@host4 [/]# dd if=/dev/hda bs=512 count=1 2>&1 | grep LILO
Binary file (standard input) matches

Both positive results... eh.. that wasn't supposed to be an option. What does that mean?

I also tried the other suggestion and got:

root@host4 [/]# /sbin/grubby --bootloader-probe
grub

The server seems to be fine... I haven't modified grub or lilo yet and it's still rebooting to the old kernel. I just don't know which config file to edit... I'm ready to try to do it manually but that's probably not a good solution.

Anybody know how to clear up the bootloader confusion that my box has?

Thanks,
Michael
James Jhurani
use the -a flag with egrep(to allow grepping a binary file), and cut your number of commands down to one using -e ...
eg:
dd if=/dev/sda bs=512 count=1 2>&1 | egrep -a -e GRUB -e LILO

Note: I'm not using IDE drives in my server, so my if= is /dev/sda not /dev/hda.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.