How to get info on my current GRUB / boot configuration?

59,947

Solution 1

Use the BootInfoScript

Check out the README if you have prblems running it.

Solution 2

To view your /boot/grub/grub/cfg file, you might use the following command,

less /boot/grub/grub.cfg

Press your up or down arrow keys to scroll up and down the file, use your 'q' key to quit and return to your regular terminal prompt. The grub-mkconfig program runs other scripts and programs such as grub-mkdevice.map and grub-probe and then generates a new grub.cfg file. It also reads files in /etc/default/grub and the /etc/grub.d/debian theme file to tell it what to do. Those are the files we can edit or create for ourselves to change our GRUB settings. I'll show you more about that later.

Below here is an example of a grub.cfg for a new Ubuntu installation in a computer that already has one other Ubuntu installation dual booting with Windows XP. I have highlighted the commented lines in yellow to draw your attention to them. You should notice that they each mark the beginning and ending of their own section of the grub.cfg and they appear in numerical sequence starting from the /etc/grub.d/00_header at the top. The last section of this file is the /etc/grub.d/40_custom area at the bottom of the grub.cfg file. Each of these sections of the grub.cfg file are controlled by the scripts with the same names, and those are the ones we edit to make changes to our grub.cfg. The changes will come into effect right after we run 'sudo grub-mkconfig -o /boot/grub/grub.cfg' to write the new grub.cfg file.

Share:
59,947

Related videos on Youtube

aqsalose
Author by

aqsalose

Updated on September 18, 2022

Comments

  • aqsalose
    aqsalose over 1 year

    First some background: I have dual-boot Windows 7 / Ubuntu 13.04 on Lenovo laptop. As I did the installation about 1.5 years ago and was then even more un-savvy linux user than I am now, I can't recall everything I did to get both OSes up and running. However, I do remember that it was quite troublesome procedure (running boot-repair at least once).

    Now I'm considering trying another linux distro in addition to Ubuntu (most likely Arch), and this time I'd like to do it in a way that I have an idea what I'm doing (and possibly learn more about 'inner workings' of linux distros).

    So that's enough for the background. Now my question is: How do I get information on what is my current grub / boot-loader configuration?

    This seems to be first and quite separate issue to consider before even dreaming about installing a third OS and more advanced messing with partitions and boot.

    • Stanislav
      Stanislav over 8 years
      You may use grub-install -v Here is another post.
  • sancho.s ReinstateMonicaCellio
    sancho.s ReinstateMonicaCellio almost 3 years
    Interesting utility, although I don't see output file RESULTS.txt giving info on Grub config. At least the latest version github.com/arvidjaar/bootinfoscript