Zum Hauptinhalt springen
Intelligence View
⚡ tsecurity.de Intelligence

Fedora GRUB2 Configuration

I’ve never been a fan of GRUB2, I much prefer the simplicity of GRUB Legacy, and as a result I never spent much time learning how to configure it; I simply h…

Beitrag
0
Seite
0
↗ Quelle (paul-moore.com)
Cloud & Tech-Stack · 4 Min. Lesezeit
Quelle: paul-moore.com
Rubrik: Server Unix e Linux

I’ve never been a fan of GRUB2, I much prefer the simplicity of GRUB Legacy,
and as a result I never spent much time learning how to configure it; I simply
hacked away at the configuration and asked Google for help when needed.
However, while debugging a kernel problem last week I finally reached my
breaking point and decided it was time for me to develop a proper GRUB2
configuration that met my needs better than the Fedora Rawhide defaults. The
resulting /etc/default/grub file is shown below:



GRUB_DISABLE_SUBMENU=yes
GRUB_TIMEOUT=20
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 rd.luks=0 vconsole.keymap=us nomodeset console=ttyS0"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --unit=0 --word=8 --parity=no --stop=1"
GRUB_DISABLE_RECOVERY=true
GRUB_DISABLE_LINUX_UUID=true

Before I explain the lines above I want to make a quick comment about grubby,
the tool used by Fedora (perhaps others?) to update the GRUB2 configuration
when new kernels are installed. It appears, at least at the time of writing,
that grubby does not honor the /etc/default/grub configuration file and may
not generate a GRUB2 boot loader file that is consistent with the desired
configuration. My workaround is to simply run the following command after a
new kernel has been installed, it will regenerate the GRUB2 boot loader file
based on the configuration in /etc/default/grub :



# grub2-mkconfig -o /boot/grub2/grub.cfg

Now let’s cover the GRUB2 configuration above, line by line. The first line
disables the submenu and places all boot loader choices in the top level
menu.



GRUB_DISABLE_SUBMENU=yes

The line below sets the timeout before the default boot option is chosen.



GRUB_TIMEOUT=20

The line below is a Fedora default that I’ve largely ignored as it doesn’t have
any impact on what I’m trying to do with my systems.



GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"

The line below is a list of parameters to pass to the kernel at boot. Most of
these are, or were, Fedora defaults at some point with the exception of
“nomodeset”, which disables the kernel graphics modesetting, and
“console=ttyS0”, which sets the console to the first serial port.



GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 rd.luks=0 vconsole.keymap=us nomodeset console=ttyS0"

These two lines tell GRUB2 to use the serial console, with the specified
configuration, instead of the graphics console.



GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --unit=0 --word=8 --parity=no --stop=1"

The line below disables the creation of a recovery kernel image and associated
boot loader option. Although be warned that even though this will prevent
GRUB2 from creating a new recovery kernel image, you may need to manually
remove any previously created recovery kernel images in order to remove the
recovery kernel from the boot loader option list.



GRUB_DISABLE_RECOVERY=true

The line below instructs GRUB2 to reference partitions by their device
name/path and not their UUID, e.g. use root=/dev/sda1 instead of
root=UUID=<xxx> .



GRUB_DISABLE_LINUX_UUID=true

That’s my GRUB2 configuration. There are plenty of other good references
online, Google is your friend of course, but if you like a simple boot loader
configuration with a serial console, I encourage you to check out the config
above, it works pretty well.



UPDATE: In order to completely remove the recovery/rescue kernel you also
need to instruct Dracut not to generate a rescue kernel and initrd. This can
be done by creating the /etc/dracut.conf.d/02-rescue.conf file with the
following contents:



dracut_rescue_image="no"

This will prevent Dracut from creating rescue images when new kernels are
installed on the system.

Social ReaktionenReagiere als Erste:r — dein Feedback zählt!
Informations-Bewertung:
✏️ Information ergänzen
🛡️ Versioniert via CMS-Revisions-Engine (Freigabe-Queue für Gäste)

💬 Discussione della community e commenti

🌐 Entra nella chat principale

Avvia la discussione nel flusso broadcast della Social Chat oppure invia qui sopra un contributo esperto tramite il modulo di integrazione.

🔍 CTI & Forensik

Cyber Threat Intelligence e Forense

Navigatore ATT&CK · Radar IoC · Evidenze Exploit
CTI Threat Relationship Graph
Akteure · Techniken · Beziehungen
3 Knoten · 2 Relationen
CVE / Incident Threat Actor Software MITRE ATT&CK CWE Weakness IoC
Briefing di sicurezza Gratuito · disdetta in 1 clic

Intelligence Digest — gratuito

Ogni giorno le notizie di sicurezza più importanti · annullabile in qualsiasi momento

Valutazione della community &amp; prova sociale
⭐ Giudizio dei lettori
–
Ø / 5.0
Ancora nessuna valutazione dei lettori
Questo articolo ti è stato utile?
0
Lascia ora la tua valutazione
Valutazione dettagliata (facoltativa)
Contenuto & qualità
Fonte & credibilità
Attualità

Cluster di storie correlate & fonti (IA vettoriale)

6 Cluster
23 fonti
Newegg knocks $200 off the 4TB KingSpec P3 SATA SSD for Black Friday
Latest from TechRadar 33 min. fa
22 altre fonti
CNET19 giorni faGTA 6 May Not Be on Sale, but These Black Friday PlayStation Deals Are Still Worth Shopping The Verge15 min. faDreame and Eufy are offering nearly 60 percent off robovacs for Black Friday Latest from TechRadar54 min. faBlack Friday Roku deals: save on Roku Streaming Sticks, Roku TVs, and more Computer Bild45 min. faBigbank erhöht Festgeldzinsen: Bis zu 3,60 Prozent zum Black Friday Golem.de44 min. faAnzeige: 65 Zoll großer OLED-TV von Samsung günstig wie nie am Black Friday Latest from TechRadar2 h faBlack Friday Pixel deals: save big on Pixel 10, Pixel 10a, Pixel 11 Pro, and more Latest from TechRadar2 h faSamsung's Black Friday sale is here — I've found 11 excellent deals, including up to $1,800 off OLED TVs, Galaxy S26 Ultra, tablets, and more Latest from TechRadar2 h faPick your favourite shade: every AeroPress colour is on sale for Black Friday Latest from TechRadar1 h faPureVPN has launched 5-year plans just in time for Black Friday — $1.49 per month for half a decade of protection Latest from TechRadar1 h faDDR5 RAM Black Friday deals: 6 32GB kits under $500 — because sadly that’s where memory prices are right now Latest from TechRadar1 h fa25 hand-picked deals in the Amazon UK Black Friday sale — Lego, Bose earbuds, Switch 2, Ninja Crispi, Kindles, and more WIRED1 h faThe 24 Very Best Amazon Black Friday Deals to Get Now (2026) heise online News1 giorno faBlack Friday 2026: Die besten Deals für Smartphones, Tablets und Smartwatches WIRED1 h faBest Black Friday Nintendo Switch 2 Deals (2026): Bundles, Games Latest from Windows Central2 h faDell's budget-friendly XPS 13 Windows laptop drops below $550 ahead of Black Friday PC-WELT1 h fa575 Euro günstiger: Solakon onPower Balkonkraftwerk mit ONE-Speicher im Black-Friday-Deal PC-WELT1 h faBlack Friday bei PC-WELT: Norton 360 Premium-Security nur 19,99 Euro PC-WELT1 h fa575 Euro günstiger: Solakon onPower Balkonkraftwerk mit ONE-Speicher im Black-Friday-Deal PC-WELT1 h faBlack Friday bei PC-WELT: Norton 360 Premium-Security nur 19,99 Euro PC-WELT1 h faBlack Friday: Diese Handytarife sind jetzt besonders günstig – von 10 GB bis Unlimited PC-WELT1 h faBlack Friday: Diese Handytarife sind jetzt besonders günstig – von 10 GB bis Unlimited Macerkopf.de2 h faZendure Black Friday: bis zu 45 Prozent Rabatt auf Balkonkraftwerke mit Speicher, Solarmodule und mehr
Articoli simili
🔍 Verwandte News

Auch interessante Nachrichten Fedora GRUB2 Configuration

Thematisch verwandte Begriffe: Fedora, GRUB2, Configuration · 6 Treffer

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

💬 Caricamento dei commenti…
Trascina per aggiornare
Widgets & Topics
Loading widgets…
Nächster Beitrag