Boot Loader Detection: GRUB or LILO?

Mike Klinke lsomike at futzin.com
Mon Oct 27 23:28:31 UTC 2003


On Monday 27 October 2003 23:07, Charles Curley wrote:
> Is there any way to detect which boot loader is the working one?
> Simply detecting whether a grub or lilo package is installed may not
> be sufficient, especially in the case where both are installed. I
> suppose I could look to see which is more recent, grub.conf or
> lilo.conf, but I can think of several scenarios unde which this would
> fail.
>
> It's time to update my bare metal recovery scripts
> (http://www.charlescurley.com/Linux-Complete-Backup-and-Recovery-HOWT
>O.html) to handle grub, and I'd like to detect the current boot loader
> if possible.

Would this method be of any use? Use "dd" to read the MBR, assuming 
that's where your boot loader resides.  I know that the word "GRUB" 
will appear; for example:

#dd ibs=512 count=1 if=/dev/hda | grep -i grub 
Binary file (standard input) matches

Someone else will have to pipe up about LILO though...

Regards,  Mike Klinke





More information about the fedora-list mailing list