Friday, January 21, 2011

Linux Boot process

when a machine is powered on, processor checks for BIOS in the memory stored as permanent read-only memory.
When a linux OS is installed in the system, BIOS detects MBR (512 bytes) which is in the first sector 0f the booting hard disk. Thus MBR is loading into the memory.
MBR contains the boot loader (LILO, GRUB) and it consumes 446 bytes of the MBR's total disk usage. MBR now with the help of entries in GRUB configuration file will displat boot menu for the users to enter their own choice (if there are multiple boot entries in grub.conf).

When a particular linux os is selected by the user, the bootloader(grub) loads the kernel corresponding to that boot entry with the help of instructions in its configuration file. Now the control is passed over to kernel. The kernel loads the root partition in read-only mode as described in the grub configuration file. It also loads the initrd image found in the path mentioned in grub config file, which is needed for booting the machine.

The kernel then starts the init process (/sbin/init) and thus it becomes the parent of all processes. pidof init is 1.

The following files are invoked by init script in the following order:

/etc/rc.d/rc.sysinit -- sets path, checks filesystems, starts swapping etc.
It initializes the system and remounts the partition in rw mode.


/etc/inittab -- sets the default runlevel

startup scripts from /etc/rc.d/rcx.d/ (x=0-6) --- starts or stops various services that are confined to run in the initiated runlevel

Also you can refer this

0 comments:

Post a Comment