Linux System Main Actors - ref boot sequence:
- System BIOS (basic I/O system)
- MBR (master boot record, located in the 1st sector of the bootable disk /dev/hda or dev/sda)
- GRUB (GRand Unified Bootloader, config file in /boot/grub/grub.conf)
- initramfs Initial ramfs, initial ram base file system.
- initrd (initial ramdisk) is a scheme for loading a temporary root file system into memory in the boot process of the Linux kernel.
- Linux Kernel
- /sbin/init lanuches bootup script from /etc/
- Runlevel (/etc/rc.d/rc*.d/, you would see programs that start with S and K.
b. Programs starts with K are used during shutdown. K for kill.
Linux System Boot Process in General - ref boot sequence:
- BIOS
- MBR located in the 1st sector of the bootable disk /dev/hda or dev/sda
- GRUB config file in /boot/grub/grub.conf
- Kernel:
/etc/inittab file then execute runlevel program
eg: grep initdefault /etc/inittab
4.2 Runlevel: - showing message
When the Linux system is booting, see various services
getting started.
e.g. it might say “starting sendmail …. OK”.
Linux System Boot Process in Detail - ref boot sequence:
1. System BIOS performs three task- Power-On Self Test(POST)
- Initial H/W setup and configuration
- Loads option ROM from add-in card (SCSI, SAN HBA, RAID)
- Selects boot device and executes MBR (master boot record, located in the 1st sector of the bootable disk /dev/hda or dev/sda)
2. First stage GRUB in MBR(445 bytes); it loads:
- stage1.5 GRUB using int13 BIOS calls, stage1.5 GRUB provides fs(filesystem) drivers and then loads stage2 GRUB
3. Second stage GRUB
- Reads and uses configuration file or displays GRUB command prompt
- Loads initial ram disk (usually specified)
- Loads, decompresses, and executes selected Linux kernel from hard drive with command line arguments
4. Linux Kernel
- Initializes and configures H/W using drivers statistically compiled into the kernel
- Decompresses the initramfs image and mount
- Runs init script from initramfs image
- init script loads kernel modules and performs task necessary to mount the real root fs(filesystem) including loading any required kernel modules stored in the initramfs image
- Mounts the root partition passed to the kernel by the boot loader using the root=kernel command-line option(usually read only) as the root partition, replacing the initrd
- Execut /sbin/init
PS: for RHEL only:
Upstart is async. replacement for the traditional init daemon. It is installed using sysvinit runlevel comptatibility mode so that it is mostly a drop-in replacement. Configuration is in the /etc/inittab and /etc/init/* files
In sum, I know it looks complicated, let me try to see whether I can make the concept easier for understanding in the coming future.
No comments:
Post a Comment