Beruflich Dokumente
Kultur Dokumente
or
What happens before the login prompt
Note: many links on this page point to files on your local file system. If you are not running Linux then they
probably will not work. There are also links to man pages. These work in konqueror, and may or may not work with
other browsers. If the link does not work just use the man command from a Linux command line.
BIOS
Load boot sector from one of:
• Floppy
• CDROM
• Hard drive
The boot order can be changed from within the BIOS. BIOS setup can be entered by pressing a
key during bootup. The exact key depends varies, but is often one of Del, F1, F2, or F10.
• BIOS loads and execute the first 512 bytes off the disk (/dev/hda)
• Standard DOS MBR will:
o look for a primary partition (/dev/hda1-4) marked bootable
o load and execute first 512 bytes of this partition
• can be restored with fdisk /mbr from DOS
LILO
• does not understand filesystems
• code and kernel image to be loaded is stored as raw disk offsets
• uses the BIOS routines to load
Loading sequence
Reconfiguring LILO
One minute guide to installing a new kernel
GRUB
• Understands file systems
• config lives in /boot/grub/menu.lst or /boot/boot/menu.lst
Kernel
• initialise devices
• (optionally loads initrd, see below)
• mounts root filesystem
o specified by lilo or loadin with root= parameter
o kernel prints: VFS: Mounted root (ext2 filesystem) readonly.
• runs /sbin/init which is process number 1 (PID=1)
o init prints: INIT: version 2.76 booting
o can be changed with boot= parameter to lilo, eg boot=/bin/sh can be useful to
rescue a system which is having trouble booting.
initrd
Allows setup to be performed before root FS is mounted
/sbin/init
• reads /etc/inittab (see man inittab which specifies the scripts below
o Run boot scripts:
debian: run /etc/init.d/rcS which runs:
/etc/rcS.d/S* scripts
/etc/rc.boot/* (depreciated)
redhat: /etc/rc.d/rc.sysinit script which: loads modules, check root
FS and mount RW, mount local FS, setup network, and mount remote FS
o switches to default runlevel eg 3.
run scripts /etc/rc3.d/S*
run programs specified in /etc/inittab
Run Levels
• 0 halt
• 1 single user
• 2-4 user defined
• 5 X11 only (0 or 1 text console)
• 6 Reboot
• Default is defined in /etc/inittab, eg:
o id:3:initdefault:
• The current runlevel can be changed by running /sbin/telinit # where # is the new
runlevel, eg typing telinit 6 will reboot.
Boot Summary
• lilo
o/etc/lilo.conf
• debian runs
o /etc/rcS.d/S* scripts
o /etc/rc3.d/S* scripts
• redhat runs
o /etc/rc.d/rc.sysinit script
o /etc/rc.d/rc3.d/S* scripts