Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

GRUB

Direct answer

GRUB 2 reads /boot/grub/grub.cfg (Debian) or /boot/grub2/grub.cfg (RHEL), generated from /etc/default/grub and /etc/grub.d. It shows the boot menu and passes kernel parameters.

When to use this

Use it to change the default kernel, add kernel parameters, or recover an unbootable system.

First 30 seconds

1. grep -E 'DEFAULT|CMDLINE' /etc/default/grub — settings.

2. RHEL: grubby --info=ALL — entries and arguments.

3. Change, then update-grub / grub2-mkconfig -o ….

4. One-time test: e at the menu, edit, Ctrl+X.

5. After boot: cat /proc/cmdline.

Operational verification

/etc/default/grub + scripts → grub.cfg generated → menu → selected entry → kernel and parameters loaded

Evidence · next step

For Boot Process → GRUB, continue with the first unproven Topic check: Identify distro-specific GRUB source files, generated configuration path and the GRUB instance reached from firmware. If that boundary is healthy, advance to the adjacent check: Inspect the exact menuentry and linux/initrd lines, especially root identifiers, LVM/RAID/encryption hints, console and recovery parameters. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to change the default kernel, add kernel parameters, or recover an unbootable system.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

GRUB binary → prefix/config location → source-generated grub.cfg → menuentry → filesystem/device resolution → linux/initrd commands → exact kernel command line → kernel handoff

Healthy evidence: the firmware-launched GRUB instance uses current generated configuration, resolves existing artifacts and hands the intended parameters to the intended kernel.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Identify distro-specific GRUB source files, generated configuration path and the GRUB instance reached from firmware.

  • Inspect the exact menuentry and linux/initrd lines, especially root identifiers, LVM/RAID/encryption hints, console and recovery parameters.
  • Compare generated entries with installed kernels/initramfs files and the actual storage topology.
  • Test a temporary edit only as a separator; then make the persistent source change, regenerate, reboot normally and verify the original workload.

Verification chain. GRUB binary → prefix/config location → source-generated grub.cfg → menuentry → filesystem/device resolution → linux/initrd commands → exact kernel command line → kernel handoff

Step 3 Commands Verify boundary
grub2-mkconfig -o /boot/grub2/grub.cfg    # RHEL
update-grub                                # Debian
grubby --default-kernel
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: configuration was edited in the wrong source or regenerated to an unused path, or a menuentry points at stale artifacts/root identifiers.

Step 5 Common mistakes Narrow the fault
  • Editing grub.cfg directly (overwritten); edit /etc/default/grub.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Edit /etc/default/grub (e.g. GRUB_CMDLINE_LINUX) and regenerate with update-grub or grub2-mkconfig; on RHEL use grubby for kernel arguments. Press e in the menu for a one-time edit (e.g. add systemd.unit=rescue.target).

Key checks
  • grubby --info=ALL — RHEL boot entries and arguments
  • systemd-analyze — boot time per stage
  • journalctl -b -p err — errors in this boot
  • journalctl --list-boots — previous boots
  • cat /proc/cmdline — kernel command line used
ReferenceWhat it is1 section · depth on demand

Core model

Separate GRUB source configuration from generated effective configuration and from the menu entry actually executed. Record the active grub.cfg location, selected menuentry, kernel/initrd paths and kernel command line. Regenerating configuration is not evidence that firmware uses that file, and editing /etc/default/grub is not effective until generation and the real boot path are verified.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

GRUB evidence ends when the correct kernel/initramfs and exact parameters are loaded from the intended GRUB instance; later kernel/root/systemd failures belong downstream.

In depth

GRUB configuration and recovery

On most distributions, GRUB's configuration file grub.cfg is generated, not written by hand. The GNU GRUB manual describes the mechanism:

  • grub-mkconfig builds grub.cfg from the scripts in /etc/grub.d/ and the settings in /etc/default/grub.
  • Custom entries belong in /etc/grub.d/40_custom or /boot/grub/custom.cfg.
  • If you write grub.cfg by hand, the distribution's automatic regeneration must be disabled.

Settings in /etc/default/grub (manual)

SettingMeaning
GRUB_DEFAULTDefault entry: number, title, ID, or saved
GRUB_SAVEDEFAULT=trueRemember the last choice (with GRUB_DEFAULT=saved)
GRUB_TIMEOUTSeconds before the default boots; 0 = immediately, −1 = wait
GRUB_TIMEOUT_STYLEmenu, countdown or hidden
GRUB_CMDLINE_LINUXKernel arguments for all Linux entries
GRUB_CMDLINE_LINUX_DEFAULTExtra arguments for the default entry only
GRUB_DISABLE_RECOVERY=trueNo generated recovery entries

The manual recommends selecting the default entry by ID rather than by title, because titles can contain device names that change.

Installation targets (manual)

Firmware / diskRequirement
BIOS + MBRGap before the first partition (at least 1000 KiB recommended)
BIOS + GPTA BIOS boot partition, type EF02, about 1 MiB
UEFIThe EFI System Partition, usually mounted at /boot/efi
host$ sudo sed -i 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=5/' /etc/default/grub
host$ sudo grub-mkconfig -o /boot/grub/grub.cfg
host$ sudo update-grub
host$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
host$ grep -E "^menuentry|^submenu" /boot/grub/grub.cfg | cut -c1-80
host$ sudo grub-reboot "Advanced options for Ubuntu>Ubuntu, with Linux 6.8.0-45-generic"

Booting by hand from the GRUB prompt

When grub.cfg is broken, the GRUB command line can still boot the system. The manual's sequence is: select the root device, load the kernel with linux, load the initramfs with initrd, then boot.

grub> search --set=root --fs-uuid 3f1c...a9
grub> linux /boot/vmlinuz-6.8.0-49-generic root=UUID=3f1c...a9 ro
grub> initrd /boot/initrd.img-6.8.0-49-generic
grub> boot

update-grub (Debian and Ubuntu) and grub2-mkconfig (RHEL family) are distribution wrappers or names for the same generator. Use the one your distribution provides.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

GRUB is part of Boot Process → GRUB. GRUB covers GNU GRUB configuration, generated menu state, device/filesystem discovery, kernel/initramfs selection and recovery editing at the Linux bootloader boundary.

Topic-specific state model. GRUB covers GNU GRUB configuration, generated menu state, device/filesystem discovery, kernel/initramfs selection and recovery editing at the Linux bootloader boundary.

Interpretation rule. - Editing /etc/default/grub ≠ generated grub.cfg changed.

  • grub configuration regenerated successfully ≠ firmware boots the GRUB installation containing that configuration.
  • GRUB menu entry loads ≠ root=, rd.* or other kernel parameters point at a usable root.
  • Temporary menu edit works once ≠ persistent GRUB configuration was repaired.

Quick reference

GRUB 2 operations:

# /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DEFAULT=saved
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=rhel/root"

grub2-mkconfig -o /boot/grub2/grub.cfg       # RHEL BIOS & UEFI (RHEL 9+ uses the same path)
grub2-editenv list
grub2-set-default 1
grub2-install /dev/sda                         # BIOS only; UEFI uses packaged EFI binaries

At the GRUB menu, press e to edit a boot entry once (add systemd.unit=rescue.target, rd.break, or remove quiet) and Ctrl+X to boot. Protect the menu with a GRUB password on physically exposed systems (grub2-setpassword).

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. GRUB evidence ends when the correct kernel/initramfs and exact parameters are loaded from the intended GRUB instance; later kernel/root/systemd failures belong downstream.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. GRUB owns GNU GRUB-specific source/generated configuration and menu execution. Bootloader owns generic handoff semantics; Package Management owns installed package lifecycle; Kernel Parameters owns parameter meaning.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Boot Process → GRUB. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://systemd.io/ · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
grub linuxgrub2 troubleshootinggrub.cfglinux grub recovery
Embedded reference data

Quick lookup tables

GRUB operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for GRUB.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateGRUB covers GNU GRUB configuration, generated menu state, device/filesystem discovery, kernel/initramfs selection and recovery editing at the Linux bootloader boundary.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact host + failed boot attempt → identify firmware mode/boot entry → capture bootloader entry + kernel/initramfs + command line → prove root-device discovery and early-userspace handoff → inspect PID 1 transaction/target → change one demonstrated cause → reboot through original path → verify service/workload readiness and regression.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainGRUB binary → prefix/config location → source-generated grub.cfg → menuentry → filesystem/device resolution → linux/initrd commands → exact kernel command line → kernel handoffTrace requested/configured state through effective state to the observed workload result.
Failure boundaryGRUB proof ends when the correct kernel/initramfs and exact parameters are loaded from the intended GRUB instance; later kernel/root/systemd failures belong downstream.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux boot evidence can establish this proof path: GRUB binary → prefix/config location → source-generated grub.cfg → menuentry → filesystem/device resolution → linux/initrd commands → exact kernel command line → kernel handoffUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured host/VM, firmware, disk, selected boot entry, kernel/initramfs, root topology, boot attempt, service set, time or workload scope. GRUB proof ends when the correct kernel/initramfs and exact parameters are loaded from the intended GRUB instance; later kernel/root/systemd failures belong downstream.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven handoff: capture the exact artifact/configuration and downstream state, change only the demonstrated cause, reboot through the original path, then repeat the original service/workload and adjacent regression checks.Continue to the next unresolved boundary while preserving the original test condition.

GRUB · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryGRUB
Topic pathBoot Process → GRUB
Runtime stateGRUB covers GNU GRUB configuration, generated menu state, device/filesystem discovery, kernel/initramfs selection and recovery editing at the Linux bootloader boundary.
Fast checks- Identify distro-specific GRUB source files, generated configuration path and the GRUB instance reached from firmware. - Inspect the exact menuentry and linux/initrd lines, especially root identifiers, LVM/RAID/encryption hints, console and recovery parameters. - Compare generated entries with installed kernels/initramfs files and the actual storage topology. - Test a temporary edit only as a separator; then make the persistent source change, regenerate, reboot normally and verify the original workload.
Verification chainGRUB binary → prefix/config location → source-generated grub.cfg → menuentry → filesystem/device resolution → linux/initrd commands → exact kernel command line → kernel handoff Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary.
Failure boundaryGRUB proof ends when the correct kernel/initramfs and exact parameters are loaded from the intended GRUB instance; later kernel/root/systemd failures belong downstream. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?