Grub configure examples

From ArchWiki

Jump to: navigation, search


i18n
English
Русский

Contents

[edit] Linux and Windows in Grub

# (0) Arch Linux
title Arch Linux
root   (hd0,3)
kernel /boot/vmlinuz26 root=/dev/hda4 ro

# (1) Windows
title Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1

[edit] Linux and Windows in Grub, with Windows on a hard drive other than the first one

If Windows is not on your first hard drive (hd0), you will have to add some "map" lines. In the following example the Arch install is on the first hard drive's second partition (hd0,1), while the Windows install is on the first partition of the third hard drive (hd2,0). The two "map" lines together make the third drive appear to be the first and vice-versa.

# (0) Arch Linux
title Arch Linux
root   (hd0,1)
kernel /boot/vmlinuz26 root=/dev/hda2 ro

# (1) Windows XP Pro
title Windows XP Professional
rootnoverify (hd2,0)
map (hd0) (hd2)
map (hd2) (hd0)
makeactive
chainloader +1

[edit] Vga - Resolution settings

Add "vga=xxx" to your kernel line.

[edit] possible values for VESA framebuffer

                640x480 800x600 1024x768 1280x1024 1600x1200
---------------+-------+-------+--------+---------+---------
256 (8 bit)    |  769     771     773       775       796
32,768 (15 bit)|  784     787     790       793       797
65,536 (16 bit)|  785     788     791       794       798
16.8M (24 bit) |  786     789     792       795       799
# (0) Arch Linux
title Arch Linux
root   (hd0,3)
kernel /boot/vmlinuz26 root=/dev/hda4 vga=791 ro

[edit] Disable devfs when using udev

For Udev add devfs=nomount to your kernel line. This is not needed since kernel 2.6.13 anymore.

# (0) Arch Linux
title Arch Linux
root   (hd0,3)
kernel /boot/vmlinuz26 root=/dev/hda4 devfs=nomount ro

ATTENTION CUSTOM KERNEL USERS ONLY: if you disable devfs in your kernel you may need to change your root= path setting to the udev standard. Following the above e.g.

# (0) Arch Linux
title Arch Linux
root   (hd0,3)
kernel /boot/vmlinuz26-custom root=/dev/hda4 ro

of course you don't need the devfs=nomount as you don't even have it in your kernel. More in this thread on the forums.

[edit] CDROM-RW for kernel 2.4.x

# (0) Arch Linux
title Arch Linux
root   (hd0,3)
kernel /boot/vmlinuz24 root=/dev/discs/disc0/part4 hdd=ide-scsi ro

[edit] Remember last boot & allow KDM to choose "reboot-to"

timeout   5
color light-blue/black light-cyan/blue
default saved

# (0) Arch Linux
title  Arch Linux
root   (hd0,4)
kernel /vmlinuz26 root=/dev/sda6 ro noapic vga=0x318 quiet
initrd /kernel26.img
savedefault

# (1) Windows XP
title Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1
savedefault

(The important parts are: default saved and savedefault.)

This config will have two effects:

  • Grub will remember the last OS You have booted into, and will select it as default the next time You reboot
  • You will be able to select the next boot target (Linux/Windows) when You reboot with KDM

You can force Grub to allways reboot into Linux if You add savedefault 0 under the Windows section (instead of savedefault). Note: As root give a command: grub-set-default (it will generate 'default' file in grub directory) - if you want use kdm 'reboot to...' options.

Personal tools