1833712 Members
2285 Online
110063 Solutions
New Discussion

identifying boot loader

 
SOLVED
Go to solution
Mandosa
Regular Advisor

identifying boot loader

is there a way to determine if a system has grub or lilo as the boot loader from the linux OS prompt.
5 REPLIES 5
Stuart Browne
Honored Contributor

Re: identifying boot loader

Sure.

ls -l /etc/{lilo,grub}.conf

you'll only have one.
One long-haired git at your service...
Gopi Sekar
Honored Contributor

Re: identifying boot loader


just a little risky method:

strings | less

eg: strings /dev/hda | less

the first few lines should have either GRUB or LILO on it.

Note: You have to run it as root user and the give the device name or partition name where bootloader is written.

Hope this helps,
Gopi
Never Never Never Giveup
Mandosa
Regular Advisor

Re: identifying boot loader

seems i have both a grub.conf and lilo.conf. both have been the default loader @ some point on this system.
What risky about the strings method (this is a producation server)

thx
Gopi Sekar
Honored Contributor

Re: identifying boot loader


not much if you are doing it carefully. strings will just read the hard disk and pipe it to less.

as long as you are not trying to write to it, then it is safe. Before typing the reply to you, i tried it on my one and only desktop which has every data of mine and till now it is working fine.

Hope this helps,
Gopi
Never Never Never Giveup
Bill Thorsteinson
Honored Contributor
Solution

Re: identifying boot loader

As root try the commands:

lilo -v

and

grub -v

One of them should be not found. If you
have both, it will take some more work
to determine which loader is being used.
If the MBR is used then the command

dd if=/dev/hda bs=512 count=1 | strings

The output will include either GRUB or LILO
if they are install in the master boot
record. If not use fdisk or cfdisk to
find the bootable partition and try the
above command replacing /dev/hda with
the bootable partion.