Grub-Bootloader anpassen (2024)

Die Rolle des Bootloaders ist der Start des Betriebssystems, nachdem Uefi oder ein herkömmliches Bios die Hardware initialisiert hat. Der heute verbreitete Bootloader nahezu aller Distributionen ist Grub 2, denn Grub 2 arbeitet mit Bios sowie Uefi zusammen und kennt alle wichtigen Dateisysteme inklusive dem noch recht jungen BTRFS. Eine interaktive Shell ist zum Debugging Gold wert und die Konfigurationsdateien werden in einer Scriptsprache geschrieben, die zusammen mit ladbaren Grub-2-Modulen recht komplexe Szenarien meistert.

Der Vorteil von Grub 2 ist gleichzeitig eines seiner Mankos: Die Komplexität macht die Anpassung nicht einfach, zumal die Dokumentation eher Entwickler anspricht. Und man kommt schnell einmal in die Verlegenheit, an Grub 2 etwas ändern zu müssen: So versteckt Ubuntu das Bootmenü von Grub 2 beim Systemstart. Dies soll einen Systemstart gewährleisten, um jedoch einen anderen Kernel zu wählen oder Bootparameter einzugeben, bleibt das Menü wichtig. Wer mehr Kontrolle über den Startvorgang wünscht, muss während des Starts genau zur richtigen Zeit die Shift-Taste gedrückt halten – oder holt sich mit einer Anpassung der Grub-2-Konfiguration das Bootmenü zurück.

Grub 2 unter der Lupe

Linux-Distributionen sind dazu übergegangen, die Grub-2-Einstellungen in Einzeldateien aufzuteilen. Grub 2 legt seine Konfiguration an drei verschiedenen Stellen ab:

1. Die Datei „grub.cfg“ liegt bei Debian/Ubuntu unter „/boot/grub/“. Sie enthält die eigentliche Konfiguration, die Grub 2 beim Start ausliest. Allerdings ist die Datei „grub.cfg“ nicht dafür gedacht, manuell bearbeitet zu werden, denn sie wird automatisch vom Grub-2-Installationsscript erzeugt.

2. Ein Vorteil von Grub 2 ist dessen Toleranz gegenüber anderen Betriebssystemen, für die der Bootloader ebenfalls Einträge in seinem Menü erstellen kann. Zum Auffinden fremder Systeme auf den Datenträgern enthält das Verzeichnis „/etc/grub.d/“ Shellscripts als Grundgerüst.

3. Zahlreiche Standardparameter von Grub 2 wie die Sichtbarkeit des Menüs und Wartezeit beim Start sind in der Datei „/etc/default/grub“ untergebracht. Diese darf bearbeitet werden und wird vom Grub-2-Installationsscript genutzt, um die Konfiguration zu bauen. Für die verbreiteten Distributionen gibt es für Änderungen am Bootloader einen fähigen grafischen Helfer. Das Tool Grub-Customizer bietet eine Menüoberfläche, um Funktionen des Bootloaders und Booteinträge anzupassen.

Grub-Bootloader anpassen (1)

Grub-Customzier einrichten

Ursprünglich ist Grub-Customizer als Projekt für Ubuntu entstanden und arbeitet inzwischen mit der Veröffentlichung der Version 4.x so zuverlässig, dass es für andere Distributionen portiert wurde.

Ubuntu und Mint: Das Repository des Entwicklers liefert Pakete für alle Ubuntu-Ausgaben. Die beiden Befehle

sudo add-apt-repository ppa:danielrichter2007/grub-customizer sudo apt-get update

nehmen das PPA (externe Paketquelle) auf und

sudo apt-get install grub-customizer

installiert das Programm.

Lese-Tipp – Diese Ubuntu-Linux-Varianten gibt es: Server, Desktop, Mobile, IoT

Debian: Das Paket für Ubuntu 14.04 lässt sich auch in Debian 8 installieren, nämlich mit dem Hilfsprogramm Gdebi, das Abhängigkeiten automatisch auflöst. Zuerst muss also das Paket „gdebi“ installiert werden. Die 32- oder 64-Bit-Pakete für Debian gibt es auf https://launchpad.net/~danielrichter2007/+archive/ubuntu/grub-customizer/+packages unter „grub-customizer – 5.0.6-0ubuntu1~ppa1t“. Mit

sudo gdebi [Paketname].deb

wird das Paket dann installiert.

Fedora: Hier liegt das Programm in den Standard-Paketquellen und ist mit sudo dnf install grub-customizer zu installieren.

Der Grub-Customizer verlangt root-Rechte zur Bearbeitung der Grub-2-Konfiguration und fragt nach dem Start das Passwort für sudo ab. Nach dem Start zeigt das Programm in der Liste „Bootloader-Konfiguration“ die Booteinträge an, die sich in der Reihenfolge verändern, umbenennen und löschen lassen. Ein Rechtsklick und „Bearbeiten“ öffnet einen Editor für das Script hinter einem Booteintrag, um zum Beispiel neue Startparameter für ein Linux-System in der Zeile „linux“ anzugeben. Aber das sind schon Detaileinstellungen für Betriebssystembastler.

Einige der wichtigsten, weil übergreifende Optionen des Bootloaders sind auf der Seite „Allgemeine Einstellungen“ untergebracht. Dort finden sich die Definition des Standard-Booteintrags, die Option „Menü anzeigen“ und ein Feld für die Wartezeit in Sekunden. Die letzte Einstellungsseite „Darstellung“ steuert das Aussehen von Grub und bietet Farbeinstellungen, Bildschirmauflösung sowie die Auswahl eines Hintergrundbildes. Bilder müssen im PNG-Format vorliegen, exakt der eingestellten Auflösung entsprechen und dürfen keine Leerzeichen im Dateinamen haben. Änderungen an den Menüfarben wirken sich nur aus, wenn auch ein Hintergrundbild ausgewählt wird, ansonsten ignoriert Grub 2 die Farbangaben.

Wichtig: Der Grub-Customizer sichert alle Änderungen immer erst nach einem Klick auf „Speichern“. Dann erzeugt er mit den getroffenen Einstellungen eine neue Datei „grub.cfg“ mit den aktuellen Einstellungen. Es ist nicht nötig, Grub 2 über die Kommandozeile zu aktualisieren.

Grub-Bootloader anpassen (3)

#20: Lite

Download

©Lite

Grub-Bootloader anpassen (4)

#19: Antergos

Download

©Antergos

Grub-Bootloader anpassen (5)

#18: Kali

Download

©Kali Linux

Grub-Bootloader anpassen (6)

#17: ParrotOS

Download

©Lorenzo Faletra

Grub-Bootloader anpassen (7)

#16: antiX Linux

Download

©antiX Linux

Grub-Bootloader anpassen (8)

#15: Deepin

Download

©Deepin

Grub-Bootloader anpassen (9)

#14: Arch Linux

Download

©Arch Linux

Grub-Bootloader anpassen (10)

#13: ReactOS

Download

©ReactOS Foundation

Grub-Bootloader anpassen (11)

#12: KDEneon

Download

©KDE e.V.

Grub-Bootloader anpassen (12)

#11: CentOS

Download

©The CentOS Project

Grub-Bootloader anpassen (13)

#10: Zorin OS

Download

©Zorin OS

Grub-Bootloader anpassen (14)

#09: openSUSE

Download

©SUSE LLC.

Grub-Bootloader anpassen (15)

#08: Solus

Download

©Solus Project

Grub-Bootloader anpassen (16)

#07: Fedora

Download

©Red Hat Inc.

Grub-Bootloader anpassen (17)

#06: Debian GNU/Linux

Download

©(SPI) Software in the Public Interest, Inc.

Grub-Bootloader anpassen (18)

#05: Ubuntu

Download

©Canonical Ltd.

Grub-Bootloader anpassen (19)

#04: elementary OS

Download

©elementary.

Grub-Bootloader anpassen (20)

#03: Linux Mint

Download

©Linux Mark Institute / Linux Mint

Grub-Bootloader anpassen (21)

#02: MX Linux

Download

©MX Community

Grub-Bootloader anpassen (22)

#01: Manjaro Linux

Download

©Manajro Linux

Grub-Bootloader anpassen (2024)

FAQs

How to manually install GRUB bootloader? ›

Process on Installing Grub Bootloader in Linux
  1. Boot into Linux. Firstly, you need to boot into your Linux system. ...
  2. Open a Terminal. ...
  3. Identify Your Disk. ...
  4. Look for the disk where you want to install GRUB, usually labeled as /dev/sda, /dev/sdb, etc.
  5. Install GRUB. ...
  6. Generate GRUB Configuration. ...
  7. Reboot Your System.
Nov 28, 2023

How to fix GRUB boot loader? ›

To fix the GRUB Bootloader Issue on Ubuntu, the following guidelines should be used properly.
  1. Open the Ubuntu ISO File.
  2. Go for the Try Ubuntu & open Terminal.
  3. Execute the command sudo add-apt-repository ppa:yannubuntu/boot-repair.
  4. Run the command sudo apt install boot-repair.
Feb 27, 2024

What is the default GRUB bootloader? ›

GRUB 2 is the default boot loader and manager for Ubuntu since version 9.10 (Karmic Koala). As the computer starts, GRUB 2 either presents a menu and awaits user input or automatically transfers control to an operating system kernel.

How do I edit the boot menu? ›

Click Start > Control Panel > System. In the System Properties window, click the Advanced tab. In the Startup and Recovery area, click Settings. Click Edit to edit the boot.

How do I change boot parameters in GRUB? ›

4 Temporarily modifying kernel boot parameters
  1. Switch on your computer. The boot process will start.
  2. In the GRUB 2 boot screen, highlight the entry you want to modify using the arrow keys ↑ and ↓.
  3. Press the E key. ...
  4. Search for the string splash=silent and remove it.
  5. To boot the entry, press F10 or Ctrl–X.

How do I force boot into GRUB? ›

GRUB access in Ubuntu

To access GRUB, press and hold Esc while the VM is booting. By default, Ubuntu images might not automatically display the GRUB pane.

Is GRUB bootloader necessary? ›

A bootloader is a program necessary to start an operating system when a computer boots up. The bootloader is the first program to run once the system boots. GRUB is used as the default bootloader in most major Linux distributions.

How do I boot from GRUB command? ›

Booting From grub>

The first line sets the partition that the root filesystem is on. The second line tells GRUB the location of the kernel you want to use. Start typing /boot/vmli , and then use tab-completion to fill in the rest. Type root=/dev/sdX to set the location of the root filesystem.

What is the command for GRUB-install? ›

Enter the command "grub-install --root-directory=/mnt /dev/sda". Be sure to replace /dev/sda with the correct device for your hard drive where the root partition exists (usually /dev/hda for IDE drives).

What to do if GRUB is corrupted? ›

Solution 2: Reinstallation of Grub using chroot

The second option is to repair Grub by running grub-install another way. The command we are using is still part of your Linux installation. The difference is that we will start SystemRescue normally, and we will access your Linux installation from chroot.

How to boot into recovery mode from GRUB command line? ›

How to boot into recovery mode, useful for determining and fixing boot issues.
  1. 1 Boot into GRUB. Turn on the laptop and tap the esc key repeatedly. ...
  2. 2 Too many ESC's. If you see the below prompt, you have gone too far. ...
  3. 3 Select Recovery Mode. ...
  4. 4 Boot into Recovery Mode.

How do I enable grub bootloader? ›

Boot into Ubuntu. Run: sudo update-grub2 and allow GRUB to update it's list of operating systems. Close Terminal. Restart Computer.

How do I change my grub bootloader settings? ›

To change the GRUB configuration, we first edit the /etc/default/grub file. Then, we use the grub2-mkconfig command to generate a new /boot/grub2/grub. cfg file using the contents of/etc/default/grub. The -o option provides the name of the output file.

Is GRUB a UEFI or BIOS? ›

UEFI is system firmware and GRUB is a bootloader built to conform to the firmware. GRUB with BIOS takes the form of boot code inside the MBR and before the first partition. With UEFI, GRUB can take the form of the single grubx64. efi file within the ESP partition.

How do I change the appearance of GRUB? ›

Start grub-customizer and choose your theme.

Only the standard theme “starfield” will show up when you start it for the first time. Choose the theme, save and reboot.

How to reconfigure GRUB in Linux? ›

Resolution
  1. Place your SLES/SLED 10 CD 1 or DVD in the drive and boot up to the CD or DVD. ...
  2. Enter the command "fdisk -l". ...
  3. Enter the command "mount /dev/sda2 /mnt". ...
  4. Enter the command "grub-install --root-directory=/mnt /dev/sda". ...
  5. Once this command completes successfully reboot your system by entering the command "reboot".
Mar 16, 2021

How do you clean up the GRUB menu? ›

Clean Up Grub Boot Menu
  • Remove Old Kernel Entries.
  • The most common clean up task for the boot menu is to remove old kernel versions lying around on your machine.
  • To remove old kernel versions, open up Synaptic Package Manager, found in the Applications > Administration menu.

How do I change the resolution of GRUB boot menu? ›

Re: How to change GRUB screen resolution ??

In /etc/default/grub you should change the line #GRUB_GFXMODE=auto to GRUB_GFXMODE="1368x768" . And uncomment the line GRUB_GFXPAYLOAD_LINUX=keep to reduce flickering during boot. After editing run sudo update-grub .

References

Top Articles
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 6204

Rating: 4.2 / 5 (73 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.