Linux Boot Process 5 — Questions and Answers
Question 1: Which file in GRUB2 is used to add custom menu entries that persist across grub2-mkconfig runs?
- /etc/default/grub
- /etc/grub.d/40_custom (Correct answer)
- /boot/grub2/grub.cfg
- /etc/grub.d/00_header
Correct answer: /etc/grub.d/40_custom
/etc/grub.d/40_custom is designed for user-added menu entries that are preserved when grub.cfg is regenerated.
Question 2: When systemd starts units in parallel, what mechanism does it use to determine dependency order?
- Alphabetical order of unit file names
- Unit file directives like After=, Before=, Requires=, and Wants= (Correct answer)
- The order entries appear in /etc/rc.d/
- Timestamps on unit files in /etc/systemd/system/
Correct answer: Unit file directives like After=, Before=, Requires=, and Wants=
systemd uses dependency directives (After=, Before=, Requires=, Wants=) in unit files to build a dependency graph for ordered parallel startup.
Question 3: What is the significance of PID 1 in the Linux boot process?
- It is the kernel itself
- It is the first user-space process, which becomes the parent of all other processes (Correct answer)
- It is the hardware interrupt handler
- It is the process that loads the initramfs
Correct answer: It is the first user-space process, which becomes the parent of all other processes
PID 1 is the init process (systemd, SysVinit, etc.) — the first user-space process and ancestor of all other user-space processes.
Question 4: Which boot parameter disables all CPU mitigations for Spectre/Meltdown vulnerabilities, sometimes used for performance testing?
- nosecurity=1
- mitigations=off (Correct answer)
- nopti nospectre_v2
- cpu.mitigations=none
Correct answer: mitigations=off
The mitigations=off kernel parameter is a single flag that disables all CPU vulnerability mitigations (available since Linux 5.2).
Question 5: What is the purpose of the 'quiet' kernel boot parameter?
- It disables network services during boot
- It suppresses most kernel messages from appearing on the console (Correct answer)
- It mounts filesystems in read-only mode
- It prevents loading of optional kernel modules
Correct answer: It suppresses most kernel messages from appearing on the console
The 'quiet' parameter sets the kernel log level low, suppressing verbose boot messages and giving a cleaner console experience.
Question 6: Which tool is used to install the GRUB2 bootloader to the MBR of a disk on BIOS-based systems?
- grub2-mkconfig
- grub2-install /dev/sda (Correct answer)
- grub2-setup --mbr
- grub-legacy-install
Correct answer: grub2-install /dev/sda
grub2-install writes the GRUB2 boot code to the MBR (or EFI partition) of the specified device.
Question 7: What does the systemd 'wants' dependency (Wants=) mean compared to 'requires' (Requires=)?
- Wants= is stronger and will fail the unit if the dependency fails
- Wants= is a weak dependency — the unit still starts even if the wanted unit fails (Correct answer)
- Wants= and Requires= are identical in behavior
- Wants= only applies to socket-activated units
Correct answer: Wants= is a weak dependency — the unit still starts even if the wanted unit fails
Wants= is a weak dependency; if the wanted unit fails to start, the dependent unit continues anyway, unlike Requires= which would propagate failure.
Which file in GRUB2 is used to add custom menu entries that persist across grub2-mkconfig runs?