4.1 About the Boot Process

Understanding the Oracle Linux boot process can help you if you need to troubleshoot problems while booting a system. The boot process involves several files and errors in these files is the usual cause of boot problems.

When an Oracle Linux system boots, it performs the following operations:

  1. The computer's BIOS performs a power-on self-test (POST), and then locates and initializes any peripheral devices including the hard disk.

  2. The BIOS reads the Master Boot Record (MBR) into memory from the boot device. (For GUID Partition Table (GPT) disks, this MBR is the protective MBR on the first sector of the disk.) The MBR stores information about the organization of partitions on that device. On a computer with x86 architecture, the MBR occupies the first 512 bytes of the boot device. The first 446 bytes contain boot code that points to the bootloader program, which can be on the same device or on another device. The next 64 bytes contain the partition table. The final two bytes are the boot signature, which is used for error detection. The default bootloader program used on Oracle Linux is GRUB, which stands for GRand Unified Bootloader.

  3. The GRUB bootloader loads the Oracle Linux kernel into memory.

  4. The kernel initializes and configures the system hardware.

  5. The kernel reads the initramfs file, extracts its contents into a temporary, memory-based file system (tmpfs), and loads the modules that the file system contains.

  6. The kernel starts the /sbin/init process with a process ID of 1 (PID 1). init is the ancestor of all processes on a system. init reads its job configuration from the /etc/init directory. The /etc/init/rcS.conf file controls how init handles system initialization.

  7. init reads /etc/inittab to determine the default run level. The entry in /etc/inittab should take the form id:N:initdefault:, where N is the default run level. If the file does not define a default boot level, the default run level is 3.

    Note

    Do not edit /etc/inittab other than to change or comment out the default run level.

    The sole function of /etc/inittab is to define the default run level. The *.conf scripts in /etc/init determine how init should behave in response to changes in system state.

    You can use a kernel boot parameter to override the default run level. See Section 4.2.1.1, “Kernel Boot Parameters”.

  8. init runs /etc/rc.sysinit to initialize the system, including:

    • setting the host name

    • initializing the network

    • mounting the /proc file system

    • initializing SELinux based on its configuration

    • printing a welcome banner

    • initializing the system hardware based on kernel boot arguments

    • mounting the file systems

    • cleaning up directories in /var

    • starting swapping

  9. init executes scripts in the /etc/rcX.d directory to bring the system to the default run level, X. The /etc/init/rc.conf file controls how init starts individual run levels. See Section 4.3, “About Run Levels” and Section 4.3.4, “About Service Scripts”.

  10. init runs any actions that you have defined in /etc/rc.local.

Note

The Upstart version of init in Oracle Linux does not keep track of system run levels. Instead, user-space utilities such as initctl implement run levels. The processes that init manages are known as jobs, which are defined by files in the /etc/init directory. init is an event-based daemon, starting or stopping jobs in response to changes in the system state, which can be the result of other jobs starting or stopping.

For information on Upstart and on how to write Upstart event handlers, see the init(5), init(8), and initctl(8) manual pages.