Boot Loader Detection: GRUB or LILO?

Leonid Mamtchenkov leonid at
Mon Oct 27 23:39:49 UTC 2003

* Mike Klinke <lsomike at> [27-Oct-2003 23:28]:
> On Monday 27 October 2003 23:07, Charles Curley wrote:
> > Is there any way to detect which boot loader is the working one?
> 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...

LILO is also detectable:

[root at monitorus2 root]# dd ibs=512 count=1 if=/dev/hda | grep LILO
1+0 records in
1+0 records out
Binary file (standard input) matches

If you will pipe "dd" output through "strings" before "grep", you will
see "|lbaLILO", if LILO is installed or "GRUB", if GRUB is installed.

 Leonid Mamtchenkov.

More information about the users mailing list