BootLoader - Change the system loaded by default

March 2017




From your "bootloader" to change the system loaded by default, proceed as follow:
(note that all these procedures are run under "root")

For Lilo


Edit configuration file /etc/lilo.conf.
substitute the value of the "default" variable by the "label" of the specific system you want to load.
e.g from the following file the default system loaded will be linux :

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
default=linux
prompt
timeout=50
message=/boot/message
 
other=/dev/hda1
        label=windows
        table=/dev/hda
 
image=/boot/vmlinuz
        label=linux
        root=/dev/hda4
        append=""
        read-only


To start on Windows you just have to change the default"variable to:

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
default=windows
prompt
timeout=50
message=/boot/message
 
other=/dev/hda1
        label=windows
        table=/dev/hda
 
image=/boot/vmlinuz
        label=linux
        root=/dev/hda4
        append=""
        read-only


After saving the file configuration /etc/lilo.conf, you need to restart lilo for the changes to take place.
Type in the following command in a terminal (under root):

/sbin/lilo -v

For Grub


Edit the configuration file base upon the version used:

/boot/grub/grub.conf or /boot/grub/menu.lst.

Substitute the value of the default variable par by the number corresponding to the specific system you want to load (note that it always begins with "0" )

From the following example the system loaded will be Linux :

default=0 
timeout=10 
splashimage=(hd0,0)/grub/splash.xpm.gz 

# section to load linux 
# entry 0 
title Linux (2.4.18-5.47) 
        root (hd0,0) 
        kernel /vmlinuz-2.4.18-5.47 ro root=/dev/sda2 
        initrd /initrd-2.4.18-5.47.img 

# section to load Windows 2000 
# entry 1 
title windows 
        rootnoverify (hd0,0) 
        chainloader +1


To start up with Windows simply change the value of the default variable:

default=1 
timeout=10 
splashimage=(hd0,0)/grub/splash.xpm.gz 

# section to load linux 
# entry 0 
title Linux (2.4.18-5.47) 
        root (hd0,0) 
        kernel /vmlinuz-2.4.18-5.47 ro root=/dev/sda2 
        initrd /initrd-2.4.18-5.47.img 

# section to load Windows 2000 
# entry 1 
title windows 
        rootnoverify (hd0,0) 
        chainloader +1


Just save your configuration. When using Grub, note that changes are made automatically, no need to restart your system.

Related


Published by netty5.
This document, titled "BootLoader - Change the system loaded by default," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).