28

I know Grub is the one installed by default when installing Ubuntu but I am faced with an embedded system running 9.10 Desktop Edition. Following are the contents of lsb-release file

ubuntu@ubuntu-desktop:/boot$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"

but this system does not have Grub bootloader and I want to find out which one its using. So any ideas?

1
  • wiki.debian.org/BootLoader lists all the boot loaders available in Debian, if you'd like to check each one. What arch is the system? Just leaving a comment as this isn't a proper answer... Feb 2, 2011 at 15:25

5 Answers 5

17

If you have the /etc/lilo.conf file then you are using LILO (LInux LOader) This means that if you type lilo for example you should see the command dialog for the lilo booter.

If you have the /boot/grub/ directory then you are using GRUB (Grand Unified Boot Loader) This means that you should be able to use all the grub file like grub-install,grub-reboot...

Ubuntu 9.10 was the first version to use GRUB2 https://help.ubuntu.com/community/DualBoot/Grub

UPDATE:

Here is a script to check inside the first sector of the hard drive for what boot manager it is using:

Assuming your hard drive is at SDA then:

sudo dd if=/dev/sda bs=512 count=1 2>/dev/null | strings | grep -Eoi 'grub|lilo|acronis|reboot'

will tell you which bootloader you are using.

You can imagine the rest...
The list of boot loaders is here: http://en.wikipedia.org/wiki/Comparison_of_boot_loaders and http://wiki.debian.org/BootLoader (For Debian based distros)
Also if you want to SEE the real binary output then add -a to the grep part. For example:

sudo dd if=/dev/sda bs=512 count=1 2>&1 | grep -a GRUB which will show you the data in that first block.

Now with this new information you HAVE to find the boot manager you are using.

6
  • 3
    nops, dont have any of these.
    – binW
    Feb 2, 2011 at 14:47
  • Updated with a small command line for you. Feb 2, 2011 at 17:25
  • Also try cycling through sda1, sda2 etc in case you have a rescue partition set up.
    – opyate
    Oct 27, 2015 at 12:13
  • How do I find out if I am on VPS and this approch does not work? (device is /dev/simfs and command produces no output)
    – thegeko
    Jan 29, 2017 at 18:17
  • 1
    What if I have /boot/grub but also /boot/efi? What is efi anyway? And if efi is also a bootloader, how can I tell which of the two is actually used?
    – BitTickler
    Jun 8, 2021 at 18:07
14

The boot info script will detect all kinds of useful information about your boot configuration:

http://sourceforge.net/projects/bootinfoscript/

4

For GRUB the command to check what version you have is:

grub-install -V

or

grub-install --version

More to find here:
https://help.ubuntu.com/community/Grub2

1
  • the grub package installs tools to help install grub, but using the tools doesn't definitely tell you which bootloader is installed on the boot disk. One could, for example, boot from grub, then install lilo packages and remove grub packages.
    – Joe A
    Nov 30, 2020 at 22:05
3

Use the dd command to read the boot sector, then use grep to know your bootloader:

dd if=/dev/hda bs=512 count=1 2>&1 | grep GRUB
dd if=/dev/hda bs=512 count=1 2>&1 | grep LILO
1
  • Nope, does not work at all. This returns a blob of binary data with no strings in them to grep through. Might only work for a very specific kind of hardware and BIOS combination.
    – feeela
    Jan 12, 2022 at 13:59
0

You are safer checking by inquiring the version from the tools itself (than using low-level dd or other artifacts).

For example, testing for lilo:

root# lilo -V
bash: lilo: command not found

root# grub-install --version
grub-install (GRUB) 2.02~beta2-22

Of course, this will not work if you have both installed. If that is the case, to avoid confusion, uninstall the ones you don't need.

2
  • 1
    bootloader packages install tools to help install the bootloader, but using those tools doesn't definitively tell you which bootloader is installed on the boot disk. You could, for example, boot from grub, then install lilo packages and remove grub packages.
    – Joe A
    Nov 30, 2020 at 22:05
  • 1
    I suppose "boot from grub" doesn't answer the question either, as this is what the OP asked in the first place. Anyway, a bit tricky, but I prefer using easier commands to avoid destructive mistakes when/if possible. If not, well, this answer is not suitable for you, then I recommend that you ry to read the other suggestions in other answers.
    – DrBeco
    Dec 3, 2020 at 3:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .