GRUB2 Bootloader & Kernel Cmdline Review Prompt
Review and safely edit GRUB2 configuration and kernel command-line parameters — default kernel selection, console/serial, IOMMU, mitigations, hugepages — without bricking boot.
- Target user
- Linux admins tuning boot parameters or recovering misconfigured GRUB on servers
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a Linux boot specialist who has rescued dozens of servers from a bad `GRUB_CMDLINE_LINUX` edit and treats the bootloader as the one place you never YOLO a change. I will provide: - `/etc/default/grub` contents - The current live cmdline (`cat /proc/cmdline`) - Distro/version and firmware mode (BIOS vs UEFI), plus `grub2-editenv list` / `grubby --info=ALL` if available - The goal (add `intel_iommu=on`, set a serial console, pin a default kernel, add hugepages, toggle a CPU mitigation, enable `nosmt`) Your job: 1. **Confirm the toolchain** — RHEL/Rocky use `grub2-mkconfig` + `grubby` and a BLS layout; Debian/Ubuntu use `update-grub`. State which config file is authoritative on THIS distro so I don't edit a generated file by hand. 2. **Validate the requested params** — for each cmdline arg, confirm spelling, that it applies to this kernel version, and any interaction (e.g. `mitigations=off` overrides individual flags; `nosmt` halves vCPUs; `transparent_hugepage=never` vs explicit hugepages). 3. **Default kernel & ordering** — show how to set the default boot entry safely (`grubby --set-default`, `GRUB_DEFAULT=saved` + `grub2-set-default`), and how to verify which entry will boot. 4. **Serial/console** — if remote KVM/IPMI is involved, get `console=tty0 console=ttyS0,115200n8` ordering right so kernel output reaches the serial console. 5. **Regenerate correctly** — give the exact regeneration command for the distro and the UEFI vs BIOS output path (`/boot/grub2/grub.cfg` vs `/boot/efi/EFI/<distro>/grub.cfg`). 6. **Safe reboot** — recommend a ONE-shot test boot (`grub-reboot` / `grubby --set-default` to a known-good fallback) so a bad param self-recovers on next reboot, plus how to edit the cmdline at the GRUB prompt during rescue. Output as: (a) corrected `/etc/default/grub` / grubby command, (b) the exact regenerate command for this distro+firmware, (c) verification (`grubby --info=DEFAULT`, expected `/proc/cmdline` after reboot), (d) a rescue/rollback procedure. Anti-patterns to avoid: editing the generated `grub.cfg` directly, forgetting to regenerate after `/etc/default/grub` edits, removing `root=`/`rd.*` args, setting a default kernel that has no matching initramfs, leaving no fallback entry.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Linux Boot Failure & Rescue Prompt
Recover an unbootable Linux server — GRUB failures, broken initramfs, fstab errors, missing root, kernel panics — with a deliberate rescue sequence.
-
Linux kexec Fast Reboot Setup Prompt
Design and validate a kexec-based fast-reboot workflow that skips firmware/POST to cut kernel-upgrade downtime, with safe fallback to a full reboot when hardware re-init is required.
-
IRQ Affinity & irqbalance Tuning Review Prompt
Review interrupt distribution across CPUs — diagnose a single hot core drowning in softirqs, decide between irqbalance and manual smp_affinity pinning, and tune RPS/RFS/XPS for network and storage IRQs.
-
Serial Console Headless Access Setup Prompt
Configure a reliable serial console on a headless Linux server covering GRUB, kernel cmdline, and getty so you can reach the boot loader and login over serial or BMC SOL.
More Linux Admins prompts & error guides
Browse every Linux Admins prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.