Bootloader
(Redirected from GRUB)
GRUB Legacy
GRUB Legacy is no longer being developed, but let's mention it for historical purposes.
title GNU/Linux root (hd0,0) kernel /boot/vmlinuz root=/dev/hda1 ro initrd /boot/initrd.img title Windows NT root (hd1,0) makeactive # Makes hd1,0 active, i.e. it modifies hd1! chainloader +1
GRUB 2
GRUB 2 has really replaced #GRUB Legacy now. The configuration is built by grub2-mkconfig
from the configuration files in /etc/grub.d
. A few defaults can be set in /etc/default/grub
/etc/default/grub
# Boot first entry per default GRUB_DEFAULT=0 # Disable the submenu, so that GRUB_DEFAULT can address each boot entry more easily. GRUB_DISABLE_SUBMENU=y # Wait this many seconds for the user to press a key GRUB_HIDDEN_TIMEOUT=0 # No countdown is displayed GRUB_HIDDEN_TIMEOUT_QUIET=true # Seconds to display the boot menu before booting GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` # Boot parameters GRUB_CMDLINE_LINUX="" # Special boot parameters for the GRUB_DEFAULT entry GRUB_CMDLINE_LINUX_DEFAULT="" # Select output device GRUB_TERMINAL=console # Disable "root=UUID=xxx" parameters # GRUB_DISABLE_LINUX_UUID=true # Disable recovery mode menu entries GRUB_DISABLE_RECOVERY="true"
Notes:
GRUB_DISABLE_SUBMENU
may not be available in earlier GRUB versions.[1][2]GRUB_DEFAULT
setting can also be used to boot nested configuration[3] items. For example, let's assume the following boot menu:
0) Linux 1) Previous Versions > 1.0) Linux_2 2.1) Linux_3
To boot "Linux_3", set GRUB_DEFAULT
to "Previous Versions>Linux_3". Numbers can also be used ("1>1"), but using the exact menu entry names may be more easy to read.
To activate the configuration:
sudo update-grub # Debian, Ubuntu sudo grub-mkconfig -o /boot/grub/grub.cfg # Fedora, Arch Linux
/boot/grub/grub.cfg
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os { insmod part_gpt insmod ext2 set root='(hd0,gpt1)' search --no-floppy --fs-uuid --set 92ed9f74-dd26-4750-9e10-d376214ab13f echo 'Loading Linux...' linux /boot/vmlinuz-2.6.32-5-amd64 root=UUID=92ed9f74-dd26-4750-9e10-d376214ab13f ro echo 'Loading initial ramdisk...' initrd /boot/initrd.img-2.6.32-5-amd64 }
LiLo
/etc/lilo.conf
# global lba32 large-memory # allow for initrds larger than 15MB map=/boot/lilo/map backup=/boot/lilo/boot.NNNN install=menu # text, menu, bmp prompt timeout=100 # 10s timeout for 'prompt' boot=/dev/hda default=Linux # serial=0,115200n8 # disk=/dev/sda # bios=0x80 # disk=/dev/hda # disk=0x81 # linux image=/boot/vmlinuz-2.6.26 label="Linux" root=/dev/hda1 append="" read-only # bsd/windows other=/dev/hda3 label="FreeBSD" optional
FreeBSD Boot Manager
tbd
Windows NTLDR
C:\boot.ini
[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect