Linux System Administration - X


Add to my manuals
368 Pages

advertisement

Linux System Administration - X | Manualzz

Table of Contents

14. bootloader ..................................................................................................................... 146

14.1. boot terminology .................................................................................................. 147

14.2. grub .................................................................................................................... 150

14.3. grub2 .................................................................................................................. 155

14.4. lilo ..................................................................................................................... 156

14.5. practice: bootloader ............................................................................................... 157

14.6. solution: bootloader ............................................................................................... 158

15. init and runlevels ........................................................................................................... 159

15.1. system init(ialization) ............................................................................................ 160

15.2. daemon or demon ? ............................................................................................... 165

15.3. starting and stopping daemons ................................................................................. 165

15.4. chkconfig ............................................................................................................ 166

15.5. update-rc.d ........................................................................................................... 168

15.6. bum .................................................................................................................... 169

15.7. runlevels ............................................................................................................. 170

15.8. systemd ............................................................................................................... 172

15.9. other systemd tools ............................................................................................... 172

15.10. practice: init ....................................................................................................... 174

15.11. solution : init ...................................................................................................... 175

145

Chapter 14. bootloader

This chapter briefly discusses the boot sequence of an (Intel 32-bit or 64-bit) Linux computer.

Systems booting with lilo are rare nowadays, so this section is brief.

The most common bootloader on Linux systems today is grub, yet this is not a Linux project.

Distributions like FreeBSD and Solaris also use grub.

Likewise, grub is not limited to Intel architecture. It can also load kernels on PowerPC.

Note that grub, while still the default in Debian, is slowly being replaced in most distributions with grub2.

146

bootloader

14.1. boot terminology

The exact order of things that happen when starting a computer system, depends on the hardware architecture (Intel x86 is different from Sun Sparc etc), on the boot loader (grub is different from lilo) and on the operating system (Linux, Solaris, BSD etc). Most of this chapter is focused on booting Linux on Intel x86 with grub.

14.1.1. post

A computer starts booting the moment you turn on the power (no kidding). This first process is called post or power on self test. If all goes well then this leads to the bios. If all goes not so well, then you might hear nothing, or hear beeping, or see an error message on the screen, or maybe see smoke coming out of the computer (burning hardware smells bad!).

14.1.2. bios

All Intel x86 computers will have a basic input/output system or bios to detect, identify and initialize hardware. The bios then goes looking for a boot device. This can be a floppy, hard disk, cdrom, network card or usb drive.

During the bios you can see a message on the screen telling you which key (often Del or

F2) to press to enter the bios setup.

147

bootloader

14.1.3. openboot

Sun sparc systems start with openboot to test the hardware and to boot the operating system.

Bill Callkins explains openboot in his Solaris System Administration books. The details of

openboot are not the focus of this course.

14.1.4. boot password

The bios allows you to set a password. Do not forget this password, or you will have to open up the hardware to reset it. You can sometimes set a password to boot the system, and another password to protect the bios from being modified.

14.1.5. boot device

The bios will look for a boot device in the order configured in the bios setup. Usually an operating system on a production server boots of a hard disk.

148

bootloader

14.1.6. master boot record

The master boot record or mbr is the first sector of a hard disk. The partitioning of a disk in primary partitions, and the active partition are defined in the mbr.

The mbr is 512 bytes long and can be copied with dd.

dd if=/dev/sda of=bootsect.mbr count=1 bs=512

14.1.7. bootloader

The mbr is executed by the bios and contains either (a small) bootloader or code to load a bootloader.

Looking at the mbr with od can reveal information about the bootloader.

paul@laika:~$ sudo dd if=/dev/sda count=1 bs=16 skip=24 2>/dev/null|od -c

0000000 376 G R U B \0 G e o m \0 H a r d

0000020

There are a variety of bootloaders available, most common on Intel architecture is grub, which is replacing lilo in many places. When installing Linux on sparc architecture, you can choose silo, Itanium systems can use elilo, IBM S/390 and zSeries use z/IPL, Alpha uses milo and PowerPC architectures use yaboot (yet another boot loader).

Bootable cd's and dvd's often use syslinux.

14.1.8. kernel

The goal of all this is to load an operating system, or rather the kernel of an operating system.

A typical bootloader like grub will copy a kernel from hard disk to memory, and will then hand control of the computer to the kernel (execute the kernel).

Once the Linux kernel is loaded, the bootloader turns control over to it. From that moment on, the kernel is in control of the system. After discussing bootloaders, we continue with the

init system that starts all the daemons.

149

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

advertisement

Table of contents