{{Header}} {{title|title= grub bootloader Configuration Changes }} {{#seo: |description=Kernel Boot Parameter Changes |image=Live-mode-promo.jpg }} [[File:Live-mode-promo.jpg|grub boot menu|thumb]] {{intro| Kernel Boot Parameter Changes }} __TOC__ = Introduction = {{mbox | type = notice | image = [[File:Ambox_notice.png|40px|alt=Info]] | text = This is a grub, not a {{project_name_long}} feature. [[Unspecific|Unspecific to {{project_name_long}}.]] Therefore [[Self_Support_First_Policy|Self Support First Policy]] applies. }} Before trying specific kernel boot parameters, it is advisable to first add them temporarily for testing or troubleshooting purposes. When the parameters have the intended effect, they can then be added permanently. Kernel boot parameters are text strings that disable/enable certain features or change specific system behaviors. To achieve the desired change, note kernel boot parameters: https://wiki.ubuntu.com/Kernel/KernelBootParameters * can be a simple keywords (like "splash" or "noapic") * are case-sensitive (for example "Noapic" would not have any effect but "noapic" would take effect) * might have an = sign to denote values (like "acpi_backlight=vendor") * might include punctuation (""i8042.noloop") Kernel boot parameters have no effect unless entered exactly as advised -- spelling/formatting errors or invalid values do not result in an error message. = Kernel Boot Parameter Change = Follow these steps to temporarily add kernel boot parameters. Useful for testing such a normal (non-recovery mode) boot while enabling verbose boot messages. Alternatively, if that is accessible Not accessible if boot is broken obviously. , see [[#Permanent Configuration Changes|Permanent Configuration Changes]]. {{Box|text= '''1.''' Restart the system. Or shut it down and power it on again. '''2.''' Access the grub menu. Repeatedly press the Esc key until the grub menu appears. Alternatively the Shift key can be held down continuously for BIOS-mode (not UEFI-mode) until the menu appears. The system might hang when holding down the Shift key. If that happens, just briefly release the Shift key and hold it down again until the grub menu appears. '''3.''' Select the relevant entry to edit. Use the arrow keys to highlight the relevant entry and then press the e key to enter edit mode. '''4.''' Add kernel boot parameter changes. Use the arrow keys to move down to the line that contains boot arguments: https://web.archive.org/web/20220312140233/https://docs.fedoraproject.org/en-US/Fedora/22/html/Multiboot_Guide/GRUB-runtime.html * On BIOS systems the line will begin with linux. * On UEFI systems the line begins with linuxefi. Press the End key to move the cursor to the end of that line. Press the space bar and carefully type in kernel boot parameters -- multiple parameters are separated with a space, but no spaces are added before/after any = signs or for punctuation in parameters. '''5.''' Reboot the system. Press Ctrl + X to boot the system with the new, temporary parameters. The effect will only last for this boot session; once the system is restarted they will no longer have any effect. }} = Permanent Configuration Changes = {{Box|text= '''1.''' Learn how to configure permanent changes. Inspect the following resources: * folder /etc/default/grub.d * file /etc/default/grub.d/40_kernel_hardening.cfg '''2.''' Create a new configuration file. {{Open with root rights| filename=/etc/default/grub.d/50_user.cfg }} '''3.''' Paste the necessary kernel parameters. Notes: * The following example uses kernel parameter nomodeset. * Replace only nomodeset with the actual kernel parameters you want to add. * Do not remove the leading text (underlined): GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX nomodeset". * Do not remove the trailing quote ('''"'''; marked in bold): GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX nomodeset'''"'''. {{CodeSelect|code= GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX nomodeset" }} '''4.''' Save. '''5.''' Regenerate grub configuration. {{CodeSelect|code= sudo update-grub }} '''6.''' Done. The process of adding a kernel parameter is complete. '''7.''' Verification. Optional. Inspect /boot/grub/grub.cfg because that is the generated file which is actually used during the boot process. }} = Inspect Grub Configuration Changes = '''1.''' Put folder /boot/grub under git version control. Git is a useful tool to record which files in a folder changed in what way. {{box|text= Git setup for folder /boot/grub. {{Git version control |sudo_maybe=sudo |folder=/boot/grub }} }} '''2.''' Change grub configuration. Make changes according to [[#Permanent Configuration Changes|Permanent Configuration Changes]]. '''3.''' See which files were modified by update-grub. From the same folder. {{CodeSelect|code= git status }} '''4.''' Inspect the changes. Using command line using default diff viewer diff which might be a bit difficult to read but an alternative is presented in the next step. {{CodeSelect|code= git diff }} A graphical diff viewer can be used. [[Unspecific]]. [[Undocumented]]. {{CodeSelect|code= git difftool }} = Inspect Kernel Command Line = To view the kernel command line of the currently booted kernel, run. {{CodeSelect|code= cat /proc/cmdline }} If too much output, use grep to filter. Note: Replace parameter with the actual kernel parameter you are looking for. {{CodeSelect|code= cat /proc/cmdline {{!}} grep parameter }} = Goodies = * https://packages.debian.org/{{Stable_project_version_based_on_Debian_codename}}/grub-image-boot * https://packages.debian.org/{{Stable_project_version_based_on_Debian_codename}}/grub-customizer = See Also = * [[Configuration Files]] * [[grub-live]] * [[Recovery]] = Footnotes = {{reflist|close=1}} {{Footer}} [[Category:Documentation]]