![[images/Pasted image 20250808204339.png]] ![[images/Pasted image 20250808205026.png]]
![[images/Pasted image 20250808204813.png]]
- Basic Input Output System (BIOS)
- older
- config stored on motherboard, typically in a ROM chip
- max drive size 2TB
- Unified Extensible Firmware Interface (UEFI)
- newer and GUI ready
- located on EFI partition
- supports GPT
- interface between HW and SW
- Boot Sources
- divide between HW and SW boot sources
- HW
- PXE uses DHCP, TFTP, and HTTP to find kernel image
- iPXE uses HTTPS to find kernel image
- SW
- memtest is stripped down OS that tests RAM
- Boot sequence
- POST (power-on self-test)
- UEFI
- GRUB2 (grand unified bootloader) enables user chose between kernel/OS options
- hold down shift on debian system to enter bootloader menu
- bootloader loads kernel based on selected option or default
- `vmlinux` - stripped down HW agnostic kernel loaded into RAM
- `vmlinuz` - compressed version of above
- `initrd` (init ramdisk) - loads enough kernel modules (drivers) to mount system based on system specific HW
- installer creates `initrd` during install process using `mkinitrd`
- `initramfs` is a temporary file system that uses auto-detection to identify kernel modules for devices required to mount system
- `cpio` archive file of the initial file system that is loaded to memory
- this loading happens after the kernel finishes starting the system, and before the user-space begins the `init` procedure
- `dracut` creates `initramfs` during the installation process
- We can use `initrd` for Linux kernels 2.4 and lower. Conversely, `initramfs` is for kernels 2.6 and above.
- load full kernel plus LKMs on disk
- editing debian boot config files
- `/boot` shows boot files such as `vimlinuz` and `initrd` ![[images/Pasted image 20250805203036.png]]
- `/boot/efi` ![[images/Pasted image 20250805203251.png]]
- `/boot/grub` includes `grub.cfg` which is the grub config file ![[images/Pasted image 20250805203318.png]]
- do not directly update this file, instead edit grub using `/etc/default/grub` or separate config files in `/etc/grub.d` ![[images/Pasted image 20250805203606.png]]![[images/Pasted image 20250805203641.png]]
- grub config file hierarchy
- 1 - `/boot/grub/grub.cfg`
- 2 - `/etc/default/grub`
- 3- `/etc/grub.d`
- editing debian grub files
- `sudo nano /etc/default/grub` to update grub config file
- then run `update-grub` to load updates
- uses `grub-install` which is the OS installer to automatically perform necessary edits
- `grub-install /dev/path` to reinstall GRUB on boot drive
- uses `grub-mkconfig` to update associated files
- editing red hat grub config files
- `sudo nano /etc/default/grub` to update grub config file
- then run `grub2-mkconfig` to replace `/boot/grub2/grub.cfg`
- no `update-grub` command like in debian
- places UEFI files in appropriate location
- `grub2-install /dev_path` to reinstall GRUB2 on boot drive if needed
- can also uses `grubby` tool
- kernel panic
- when installing a new kernel the previous version is kept for rollback purposes
- go to bootloader menu to rollback
- `sudo runlevel` returns current runlevel for system ![[images/Pasted image 20250802204143.png]]
- runlevels represent different system states
- 0 = halt state
- 1 = single-user mode
- 5 = default multi-user mode
- 6 = reboot