Unit 4 - The Boot Process
Unit 4 - The Boot Process
va-scan
Interactive boot, system will prompt you Boot into single user or maintenance mode Use after installing new HW Mount / as writable for repair Verbose mode
Copyright 2002, Marchany
va-scan
Kernel Phase
The kernel is the software that manages access to the OS and hardware resources. Two sections
Platform independent piece called genunix. Platform dependent piece called unix.
ufsboot loads these 2 pieces into memory, starts the kernel and hands control over to it. The kernel uses ufsboot to locate and load modules needed to complete the boot process. Modules are software programs that control a va-scan Copyright 2002, Marchany certain piece of HW.
Kernel Phase
Main kernel files are located:
/platform/ARCH/kernel /platform/ARCH/kernel/sparcv9 Where ARCH is the architecture of the system (uname
Kernel Phase
The kernel then mounts / Reads its config file (/etc/system) and configures itself. This file is read once at boot. If you make changes to it, you must reboot for them to go into effect. Be careful with this file. If you mess it up, you wont be able to boot.
va-scan Copyright 2002, Marchany
Init Phase
Once the kernel is loaded, it loads and executes the init process. The init phase is the last step in the boot process. Init is the ancestor of all processes that run on the system. Config file is /etc/inittab which describes the run levels and the processes that are to be run as the system transitions from 1 run level to another.
va-scan Copyright 2002, Marchany
/etc/inittab
ID:run level:ACTION:Process ID 1-4 character string that identifies the entry Run level run level the system must be to run the process. 0 halt/shutdown, 1 single user, 2 multiuser no network, 3 multiuser with network, 5 powerdown, 6 reboot. Default run level is 3. ACTION keyword describes how the process is to be run
va-scan Copyright 2002, Marchany
/etc/inittab
ACTION keywords
Sysinit process is run before the console login
prompt is displayed Initdefault defines the default run level where the system will operate. Init will cycle through the run levels unitl it reaches this level. Respawn defines a process that should be started if it is note currently running. If it terminates, restart it again. Wait tells init to wait until this process is finished.
va-scan Copyright 2002, Marchany
/etc/initab
ACTION keywords
Once process is started when init activate the
entry but it is not restarted when it completes. Boot process that init begins at boot time. Run only once.
PROCESS th command or script that is to be run when the entry is activated by init. The system run level scripts are started from here.
va-scan Copyright 2002, Marchany
Run Levels
Determine the number of users that can access the system and what is available to those users. There are 8 predefined run levels but you can add your own. Run levels 0, 5, 6 are transition run levels.
va-scan
by the /sbin/rcX scripts. Centralized location, these scripts start or shut down the service on the system. Name Syntax: Sxxservice or Kxxservice
va-scan
S start (run at boot) K kill (run at shutdown) Xx order number the service is started Service short name for the particular service
Copyright 2002, Marchany
va-scan
Possible Scenarios
Modified /etc/system and Use reboot command need to reload it System needs to be shutdown immediately Currently in multiuser mode but need to go to maintenance mode Need to shutdown gracefully
va-scan
Use halt command Use init 1 or telinit 1to transition to maintenance mode Shutdown i 0 g 300, for example