Modifier les options de démarrage dans Grub
Introduction
This guide explains how to temporarily or permanently change your boot options. Boot options may be necessary if a system freezes when trying to install Ubuntu or if an existing installation will not boot or otherwise needs adjustment.
Change Boot Options During Install
When you boot with an Ubuntu Live CD you will be presented with a screen similar to this:
Press the F6 key to select Other Options. This will take you to another screen with a Boot Options line similar to this one:
To enable or disable certain boot options, simply add or remove the options you need (from this list, for example) to the end of the Boot Options line, with a space between each one. Once finished, press the Enter key to boot the machine.
Here is an example of adding the vga=771 option to the end of the Boot Options line:
Change Boot Options Temporarily For An Existing Installation
- These instructions only apply to installations that use Grub - Ubuntu's default boot loader.
When you boot your computer, you will see a Grub message with a 3 second timer. When you see this message, press the Esc key:
You will see a menu which will look similar to this:
Choose which kernel you want to work with. If you don't know which one, choose the first line. Press the e key to edit the line, and you will be presented with a screen like this:
Then you will be presented with a screen with various lines. Use your down arrow key to highlight the "kernel" line. Press the e key to edit the kernel line. You will be presented with a screen like this:
Then add or subtract whichever boot option you wish (in the above screenshot, vga=771 was added). Press the Enter key when you are done with the changes. Press the b key to boot the machine with the boot options you selected.
Change Boot Options Permanently On An Existing Installation
- These instructions only apply to systems that use Grub - Ubuntu's default boot loader.
In order to permanently change your boot options, you'll need to edit the /boot/grub/menu.lst file.
Before you begin, open a terminal window and type this command to back up the file with a copy that has the current date and time appended to its name:
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.`date +~%b-%d-%Y~%T`
Type this command to edit the menu.lst file:
sudo nano /boot/grub/menu.lst
Use your arrow keys to move your cursor to the line that starts with "# kopt=".
Add or subtract whichever boot option(s) you'd like to the end of that line, with a space between each one.
Press the Ctrl and o (this is the letter o) keys at the same time.
Verify that the filename is correct (edit the filename if it's not) and press the Enter key to save the file.
Press the Ctrl and x keys at the same time to exit the editor.
Type this command to update the menu entries in the system:
sudo update-grub
Note: If you edit the menu entries directly from Grub, your changes will disappear the next time update-grub is run, for instance or when the kernel or grub packages are updated.
Common Boot Options
This list is not comprehensive but it contains some common boot options. When presented with the text on the screen "boot:" then the boot options below can be given. They must have the kernel name before the option.
Example
Adding the vga=771 option:
boot: /boot/vmlinuz-2.6.15-26-k7 root=/dev/hda1 ro quiet splash
boot: /boot/vmlinuz-2.6.15-26-k7 root=/dev/hda1 ro quiet splash vga=771
Options can be used together such as in this example:
/boot/vmlinuz-2.6.15-26-k7 root=/dev/hda1 ro quiet splash noapic nolapic
Kernel Options
Note: These options are used by the kernel, and will apply to any installation at any time. The file "Documentation/kernel-parameters.txt" in the relevant linux-source package provides more information.
Option | Impact |
vga=xxx | Set your framebuffer resolution to VESA mode xxx. Check here for a list of possible modes. |
acpi=off OR noacpi | This parameter disables the whole ACPI system. This may prove very useful, for example, if your computer does not support ACPI or if you think the ACPI implementation might cause some problems (for instance random reboots or system lockups). |
acpi=force | Activates the ACPI system even if your computer BIOS date is older than 2000. This parameter overwrites acpi=off and can also be used with current hardware if the ACPI support is not activated despite apm=off. |
pci=noacpi OR acpi=noirq | These parameters disable the PCI IRQ routing |
pci=acpi | This parameter activates the PCI IRQ routing |
acpi_irq_balance | ACPI is allowed to use PIC interrupts to minimize the common use of IRQs. |
acpi_irq_nobalance | ACPI is not allowed to use PIC interrupts. |
acpi=oldboot | Deactivates the ACPI system almost completely; only the components required for the boot process will be used. |
acpi=ht | Impact Deactivates the ACPI system almost completely; only the components required for hyper threading will be used. |
noapic | Disable the "Advanced Programmable Interrupt Controller (APIC)". |
nolapic | Disable the "local APIC". |
apm=off OR noapm | Disable the Advanced Power Management. |
irqpoll | Changes the way the kernel handles interrupt calls (set it to polling). Can be useful in case of hardware interrupt issues. |
xforcevesa | Force X to start using VESA driver. Usefull for some notebooks with uncommon video interfaces. |
Initrd break points
These options will cause the initrd to pause execution and spawn a shell. Only one option at a time may be specified (the last wins). See also: /usr/share/initramfs-tools/init and /usr/share/initramfs-tools/scripts/*.
Option | Impact |
break=top | Break before any scripts are run (including usplash) |
break=modules | Break before any modules are loaded |
break OR break=premount | Break before the premount scripts are run (ie: udev) |
break=mount | Break before the root partition is mounted |
break=bottom | Break before the 'bottom' scripts are run |
break=init | Break just before control is handed over to /sbin/init. |
(This list is far from complete, please feel free to add some options.)
Installer options (user-land)
These options are usually used when installing a system, and are picked up by the installer program or start-up scripts, and not by the kernel.
Option | Impact |
debian-installer/framebuffer=false | Disable framebuffer. |
hw-detect/start_pcmcia=false | Don't start PCMCIA. Personal Computer Memory Card International Association, one of the stranger names for a piece of hardware. |
netcfg/disable_dhcp=true | Force static network config. |
bootkbd=uk | Set keyboard map. Use a two letter ISO country code to get the right letters on the right keys. This option can help with password problems. |
(This list is far from complete, please feel free to add some options.)
See Also
GrubHowto - A guide for configuring Grub.