mintCast 155: GRUB Mysteries

Listen: mintcast155.mp3 or mintcast155.ogg

News:

The Main Topic: The Mystery of GRUB

  • James Eaton sent in a great link on the whole process of booting Linux. (infosecinstitute.com)
  • GRUB, the GRand Unified Bootloader. “GNU GRUB is a very powerful boot loader, which can load a wide variety of free operating systems, as well as proprietary operating systems with chain-loading.”
  • How does GRUB know what to boot? It reads /boot/grub/grub.cfg.
    • grub.cfg is written in GRUB’s built-in scripting language, which has a syntax quite similar to that of GNU Bash and other Bourne shell derivatives.
    • The program grub-mkconfig generates a grub.cfg file based on the scripts in /etc/grub.d and the /etc/default/grub file.
    • grub-mkconfig does have some limitations. While adding extra custom menu entries to the end of the list can be done by editing /etc/grub.d/40_custom or creating /boot/grub/custom.cfg, changing the order of menu entries or changing their titles may require making complex changes to shell scripts stored in /etc/grub.d/. This may be improved in the future.
    • The file /etc/default/grub controls the operation of grub-mkconfig. It is sourced by a shell script, and so must be valid POSIX shell input; normally, it will just be a sequence of ‘KEY=value’ lines, but if the value contains spaces or other special characters then it must be quoted.
    • ‘update-grub’ is a stub for running: ‘grub-mkconfig -o /boot/grub/grub.cfg’
  • Simple changes to try…
    • Change the default OS booted:
      • Change GRUB_DEFAULT in /etc/default/grub
      • Run ‘sudo update-grub’ to update /boot/grub/grub.cfg
    • Change the colors of the GRUB screen:
      • Edit /etc/grub.d/06_mint_theme to change these lines:
      • set menu_color_normal=white/black
      • set menu_color_highlight=white/light-gray
      • Run ‘sudo update-grub’
    • Add a background graphic: (Doesn’t work in Mint because of 06_mint_theme?)
      • Move one picture that is the same size as your screen resolution to /boot/grub/ (first one found is used?)
      • Run ‘sudo update-grub’
    • Change the order of the OS list:
      • Use the “maintenance-free Grub2 menu” article… (help.ubuntu.com)
      • Involves editing the scripts in /etc/grub.d
    • Recover your system if it won’t boot due to messed up MBR:
      • This can happen if you install Windows after installing Linux, but can also happen if you change hard drive settings or and or remove a hard drive (help.ubuntu.com)
  • GNU GRUB Manual 2.00~rc1. (gnu.org)
  • GRUB 2’s major improvements over the original GRUB. (help.ubuntu.com)
  • GRUB 2 bootloader – Full tutorial. (dedoimedo.com)
  • How to Configure the Linux Grub2 Boot Menu the Easy Way (Uses a program named “Grub Customizer” from a PPA). (howtogeek.com)

Featured Website and Tip:

  • How to measure the speed of your SATA devices from the command line. (linuxaria.com)

More Information:

Hosts:: Rob, Scott, James

Live Stream (Mondays at 8:00 p.m. Eastern): mintcast.org

Contact Us:

More Linux Mint info: website, blog, forums, community

Credits: Podcast Entry and exit music provided by Mark Blasco (podcastthemes.com). The podcast’s bumpers were provided by Oscar.


9 Replies to “mintCast 155: GRUB Mysteries”

  1. Bill_MI

    Hi guys! Rob, that was an excellent piece on GRUB – wish I had it a few months ago. 🙂

    To make a long story short, I’ve been fighting GRUB2’s graphical mode not agreeing with VirtualBox on my system. I watched as GRUB2 evolved and took longer… and longer… to get to the GRUB menu. OpenSUSE 12.3 is the pinnacle of time, taking over 2 minutes to get there.

    In comparison, grub-legacy is about 3 seconds.

    I’m now quite sure it’s my old Pentium D CPU, probably combined with other system limitations, making VirtualBox extremely inefficient in handling the GRUB2 graphics mode. The Pentium D lacks some specific virtualization capabilities that may be involved.

    Now, OpenSUSE 12.3 taking 2 minutes is one thing. But a native install still takes 12 seconds. 12 SECONDS? What do others see? I think 12 seconds is still way too long for a boot loader to come up.

    If anyone else experiences this, there IS a solution. DON’T USE GRUB2 GRAPHICS! Here’s what I’ve been doing…

    Find this line in /etc/default/grub

    # Uncomment to disable graphical terminal (grub-pc only)
    #GRUB_TERMINAL=console

    Do what it says and don’t forget to run update-grub or grub-mkconf as appropriate.

    OpenSUSE 12.3 users watch out! Someone has done a disservice and edited their way to an invalid comment. You’ll find these lines instead:

    # Uncomment to disable graphical terminal (grub-pc only)
    GRUB_TERMINAL=gfxterm

    Someone changed the option with no regard to the comment above it which is only there to help. This is just 1 example of the kind of issues I’ve seen trying to understand GRUB. It’s bad enough to get a grasp, yet alone fight sloppy information!

    When you disable graphics mode it’s not as pretty but compare the speed! I suspect many will be surprised.

    The other thing I’ve been doing is changing to grub-legacy. It’s not hard but it is risky and best to get down in a VM first.

    Sorry so long. But egad… GRUB is like that! 🙂

    All The Best!

    • merelyjim

      Bill, all I can say is, if I could e-mail you a beer, I would. GRUB is like that, and UFI added to the mix doesn’t make it any easier.

  2. Paul

    You alluded to one of the issues that keeps people from fully adopting a linux dist, that is it’s inability to deal with syncing apple ipods, ipads and such.

    A second important issue for some of us is linux’s inability to work with the Overdrive software our library uses to loan out ebooks and audiobooks via the internet.

    Until Linux shows these capabilities I will continue to dual boot and split my time between Apple/Windows and my linux dist (Ubuntu).

    Informative show thanks.

  3. merelyjim

    The Chromebook experience…

    After playing with ChromeOS for a week, I switched the machine over to the developer’s channel, partitioned the drive with an Ubuntu base, Xfce desktop, and found myself opening Chromium and using the exact same cloud services I used in ChromeOS. It’s nice having access to a CLI, but since I store nothing on the tiny 16GB SSD, I don’t find myself using it very often.

    It’s all about the Cloud…

    Still love the show, even if I haven’t posted much in the past few weeks. Always enjoy it.

Leave a Reply to Paul Cancel reply

Your email address will not be published. Required fields are marked *

Linux Mint

The distribution that spawned a podcast. Support us by supporting them. Donate here.

Archive.org

We currently host our podcast at archive.org. Support us by supporting them. Donate here.

Audacity

They’ve made post-production of our podcast possible. Support us by supporting them. Contribute here.

mintCast on the Web

Episode Archives

This work is licensed under CC BY-SA 4.0

This Website Is Hosted On:

Thank You for Visiting