# Debian Kernel and Modules The kernel is Debian's core OS. Modules are pluggable drivers and features. ## Kernel Info Show running kernel version: ```bash uname -r uname -a # verbose ``` Check available kernel images: ```bash dpkg -l | grep linux-image ``` ## Kernel Upgrade Check for newer kernel: ```bash sudo apt update apt search linux-image ``` Install new kernel: ```bash sudo apt install linux-image-amd64 # meta-package (recommended) ``` Then reboot: ```bash sudo reboot ``` After reboot, verify: ```bash uname -r ``` Remove old kernels (frees space): ```bash sudo apt autoremove ``` ## Modules Loadable kernel modules extend functionality without reboot. List loaded: ```bash lsmod lsmod | grep nvidia ``` Load module: ```bash sudo modprobe e1000 # Ethernet driver ``` Unload module: ```bash sudo rmmod e1000 ``` Check module info: ```bash modinfo e1000 ``` ## Module Configuration Persist module loading in `/etc/modules-load.d/`: ```bash echo "ip_forward" | sudo tee /etc/modules-load.d/ip-forward.conf ``` Or `/etc/modules` (older): ```bash echo "ip_forward" | sudo tee -a /etc/modules ``` Module options in `/etc/modprobe.d/`: ```bash echo "options e1000 debug=1" | sudo tee /etc/modprobe.d/e1000.conf ``` Apply: ```bash sudo update-initramfs -u ``` ## Boot Process 1. BIOS/UEFI loads bootloader 2. Bootloader (GRUB) loads kernel and initramfs 3. initramfs is tiny filesystem with essential modules/tools 4. Kernel extracts initramfs into RAM, mounts root, runs init 5. `systemd` (PID 1) starts services Bootloader config: ```bash sudo nano /etc/default/grub sudo update-grub ``` Rebuild initramfs (after major changes): ```bash sudo update-initramfs -u -k all ``` ## Kernel Parameters Set at boot via GRUB cmdline. Edit `/etc/default/grub`: ``` GRUB_CMDLINE_LINUX="quiet splash acpi_osi=" ``` Apply: ```bash sudo update-grub ``` View current parameters: ```bash cat /proc/cmdline ``` ## Common Issues - Module not loading → check `journalctl`, verify hardware compatibility - Kernel panic → likely hardware or driver issue - High memory use → `htop` to identify processes - Old kernel booting → check GRUB default in `/etc/default/grub`