How to check what bootloader my System is using?

Such as Lilo or Grub or Grub2. How can I check it?

  • lilo was used early on in linux. usually or most currently it is GRUB 2 – Ringtail Feb 24 '12 at 22:24

Assuming your boot disk is /dev/sda (it usually is), you can look at your boot sector to see what your computer starts with:

sudo file -s /dev/sda

This shows some information about what's at the beginning of /dev/sda (your hard disk — often the boot disk if you have several). For example, mine begins with

/dev/sda: x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, …

showing that I have Grub 2 (which is the default bootloader on Ubuntu these days).

Another place to look is what scripts run when you install the kernel. One or more of these scripts should register the newly installed kernel with the bootloader. These scripts live in /etc/kernel/postinst.d.

Usually, the two methods will give the same result. They won't if you have multiple operating systems and Ubuntu's bootloader is not the one that loads first, but rather is invoked by some other operating system's bootloader.

  • Errm, but you know it is Grub2 by some more information which you didn't include it here, right? Because I have the same start as you, but later in this line I see "GRUB version 0.97". – greenoldman Nov 7 '14 at 7:51
  • @greenoldman I think you're right. I don't remember why I wrote this. I may have thought that the stage1 version indicated the Grub version, at least with enough precision to distinguish between Grub 0.9x and 1.9x, but version 3 exists in both 0.9x and 1.9x. – Gilles 'SO- stop being evil' Nov 7 '14 at 15:18

Download bootscript and install http://bootinfoscript.sourceforge.net/

This boot_info_script is a bash script which searches all hard drives attached to the computer for information related to booting. Its primary use is for troubleshooting booting problems. For instructions see http://bootinfoscript.sourceforge.net



file -s /dev/sda

does not work, try

file -sk /dev/sda

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.