Linux Boot Process 3 — Questions and Answers
Question 1: Which kernel parameter would you add to a GRUB2 boot entry to boot Linux into emergency mode?
- init=/bin/emergency
- systemd.unit=emergency.target (Correct answer)
- runlevel=0
- linux.emergency=1
Correct answer: systemd.unit=emergency.target
Passing systemd.unit=emergency.target on the kernel command line tells systemd to boot into emergency.target.
Question 2: What does UEFI Secure Boot verify during the boot process?
- That the filesystem is not corrupted
- That bootloader and kernel are signed with trusted cryptographic keys (Correct answer)
- That the CPU microcode is up to date
- That all kernel modules are compiled from source
Correct answer: That bootloader and kernel are signed with trusted cryptographic keys
Secure Boot uses cryptographic signatures to verify that the bootloader and kernel haven't been tampered with.
Question 3: Which file does the kernel read to determine the location of the initial RAM disk image?
- The kernel reads it from GRUB's configuration
- It's compiled into the kernel as a built-in path
- The bootloader passes it as a kernel parameter (initrd=) (Correct answer)
- It reads /boot/initrd.conf at startup
Correct answer: The bootloader passes it as a kernel parameter (initrd=)
The bootloader (e.g., GRUB2) passes the initrd/initramfs path to the kernel via the initrd= boot parameter.
Question 4: In a system using SysVinit, which script is executed first after the kernel mounts the root filesystem?
- /etc/rc.local
- /sbin/init (Correct answer)
- /etc/inittab
- /etc/rc.sysinit
Correct answer: /sbin/init
/sbin/init is PID 1 and the first process executed by the kernel after root filesystem mount in SysVinit systems.
Question 5: What is the role of the MBR (Master Boot Record) in legacy BIOS booting?
- It stores the full GRUB configuration
- It contains the first-stage bootloader and partition table (Correct answer)
- It holds the kernel image
- It manages hardware interrupt routing
Correct answer: It contains the first-stage bootloader and partition table
The MBR is the first 512 bytes of the disk, containing the first-stage bootloader code and the partition table.
Question 6: Which command regenerates the GRUB2 configuration file on a Red Hat/CentOS system?
- grub2-install /dev/sda
- grub2-mkconfig -o /boot/grub2/grub.cfg (Correct answer)
- update-grub
- grub2-update --rebuild
Correct answer: grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkconfig generates grub.cfg from /etc/default/grub and scripts in /etc/grub.d/.
Question 7: At which stage of boot does the Linux kernel decompress itself?
- Before the bootloader runs
- Immediately after the bootloader transfers control to it (Correct answer)
- After mounting the root filesystem
- During initramfs initialization
Correct answer: Immediately after the bootloader transfers control to it
The kernel image is typically compressed; it decompresses itself into RAM as the very first action after receiving control from the bootloader.
Which kernel parameter would you add to a GRUB2 boot entry to boot Linux into emergency mode?