490 likes | 1.01k Views
System initialization. Unit objectives Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with Windows Understand how the init daemon initializes the system at boot time. Topic A: Booting and boot loaders. The boot process.
E N D
System initialization Unit objectives • Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with Windows • Understand how the init daemon initializes the system at boot time
The boot process • Bios functions • Power On Self Test (POST) • Tests hardware components • Searches for boot device • Master Boot Record (MBR) • Located on the first sector of the first hard disk drive • Used to define partitions and a boot loader • Boot loader • Program used to load an operating system • Init (initialize daemon) • Loads other system daemons
Boot loaders • Loads the Linux kernel into memory • May perform other functions • Pass system configuration to kernel • Select different kernel versions • Boot other OSes • The two most common boot loaders • LILO • GRUB
Common LILO keywords • /etc/lilo.conf • The LILO configuration file • Includes boot device, image name, etc continued
Common LILO keywords continued
Using LILO to control system • Can pass parameters at boot time • append= • Can pass information to kernel at boot • Must update LILO when kernel is changed • Lilo • Can also fix conf by using a boot device and manually making changes continued
GRUB • GRand Unified Bootloader (GRUB) • Resembles common UNIX boot loaders • Newer than LILO • First major part typically resides on the MBR • Remaining parts reside in the /boot/grub directory
GRUB • Similar information to lilo is stored in grub.conf file • Can manually edit grub config. Nothing needs to be updated • Can also append details at boot time
GRUB • Can be installed with grub-install command • grub-install /dev/hda • Into MBR • grub-install /dev/hda1 • Into first primary partition
Dual booting • Dual boot • Configuration where two or more operating systems exist on the hard disk • Using LILO or GRUB, it is easiest if Linux is installed after the other operating system has been installed
Dual booting • Can also use the ntloader to load Linux in a dual boot • Use dd to copy the grub information • linboot.ini • Copy linboot.ini to C: in windows • Edit the boot.ini • Point to the linboot.ini file
FIPS • First non-destructive Interactive Partition Splitter (FIPS) • Program used to create a new partition out of the free space on an existing FAT16 or FAT32 partition • Resizing the Windows partition using FIPS will preserve the Windows operating system on the Windows partition yet allow for free space to install Linux
Using FIPS • Guidelines/limitations to using FIPS • Version 2.0 supports the FAT16 and FAT32 filesystems only • Will only work with primary Windows partition • Will not resize logical drives within extended partitions • Works by splitting the Windows partition into two primary partitions • There must be sufficient free space within the existing Windows to allow for the installation of Linux
QUESTION 738 A customer has recompiled his kernel to a new image including new modules. GRUB is not being used as the boot loader. After editing the necessary configuration files, what command should be issued? A. /etc/lilo B. /sbin/lilo C. /sbin/loadlin D. ./start kernel
QUESTION 738 A customer has recompiled his kernel to a new image including new modules. GRUB is not being used as the boot loader. After editing the necessary configuration files, what command should be issued? A. /etc/lilo B. /sbin/lilo C. /sbin/loadlin D. ./start kernel Answer: B
Which of the following statements is not true about LILO? A. It can be used on a floppy to boot Linux. B. It must replace the master boot record on your hard drive. C. It will work with other operating systems such as DOS and Windows. D. It can specify up to 16 different boot images.
Which of the following statements is not true about LILO? A. It can be used on a floppy to boot Linux. B. It must replace the master boot record on your hard drive. C. It will work with other operating systems such as DOS and Windows. D. It can specify up to 16 different boot images. Answer: B.
A user has overwritten the master boot record. How could the Linux record be restored? A. edit fstab B. edit lilo.conf C. run "fdisk /mbr" D. run "/sbin/lilo"
A user has overwritten the master boot record. How could the Linux record be restored? A. edit fstab B. edit lilo.conf C. run "fdisk /mbr" D. run "/sbin/lilo" Answer: B.
What is initialization • init • The first daemon process on the system • Starts the other daemons • Stops daemons at shutdown • /etc/inittab • The configuration file for the init daemon
Runlevels • Runlevel • Stages of system startup • Defines the type and number of daemons started • Runlevels are often called initstates
Linux runlevels continued
Runlevel commands • runlevel command • Used to display the current and most recent previous runlevels • init command • Used to change from one runlevel to another • telinit command • An alias to the init command
The /etc/inittab file • Defines the daemons that run at each runlevel • Specifies default runlevels • Specifies which scripts are run at which level
The /etc/inittab file • /etc/rc.d/rc.sysinit • The first script executed during system startup • initializes the hardware • sets environment variables such as PATH and HOSTNAME • checks filesystems • performs system tasks needed for daemon loading.
The /etc/inittab file, continued • Mingetty • Program used to display a login prompt on a character-based terminal • /etc/rc.d/rc.local • Final script executed during system startup • Entry format • Label: runlevel(s) : action : command
The /etc/rc.d/rc# files • List the daemons that should be started • Daemons with s are started at that level • Daemons with k are killed at that level
Configuring daemon startup • /etc/rc.d/rc*.d • The directories used to start and kill daemons in each runlevel • /etc/rc.d/init.d • The directory in which most daemons are located • Most daemons take commands • /etc/rc.d/init.d/xinted restart • Restarts xinted daemon
Configuring daemon startup • To add to a runlevel • Add executable file to /etc/rc.d/init.d • Create symbolic links to daemon in all runlevels you want it started • Create symbolic links in runlevels you want it killed
Unit summary • Learned about the boot sequence, configured LILO and GRUB boot loaders, and learned about dual boot configurations • /etc/lilo.conf • /etc/grub.conf • MBR or first block in partition • Can reconfigure using a boot disk
Unit summary • Learned about how the init daemon initializes the system at boot time, and different runlevels
Which of the following runlevels is generally used to ensure the Linux server will boot into full multiuser mode without starting X Windows? A. 0 B. 3 C. 5 D. 6
Which of the following runlevels is generally used to ensure the Linux server will boot into full multiuser mode without starting X Windows? A. 0 B. 3 C. 5 D. 6 Answer: B
A Linux administrator just installed Xfree86. Which of the following files should the administrator edit in order to change the default system runlevel from 3 to 5? A. /etc/inittab B. /etc/runlevels C. /etc/rc.sysinit D. /etc/defaultrunlevel
A Linux administrator just installed Xfree86. Which of the following files should the administrator edit in order to change the default system runlevel from 3 to 5? A. /etc/inittab B. /etc/runlevels C. /etc/rc.sysinit D. /etc/defaultrunlevel Answer: A
Each entry in the /etc/inittab file contains four fields the third of which is the Action field. What is the purpose of this field? A. Identifies the entry. B. Specifies the command to execute. C. Defines how to handle the entry. D. Defines which runlevels this line applies to.
Each entry in the /etc/inittab file contains four fields the third of which is the Action field. What is the purpose of this field? A. Identifies the entry. B. Specifies the command to execute. C. Defines how to handle the entry. D. Defines which runlevels this line applies to. Answer: C.