A kernel is made of files you can find. Knowing them helps when an update fails or /boot fills up.
The /boot directory
ls /bootOn Ubuntu you might see:
config-6.8.0-45-generic
grub
initrd.img-6.8.0-45-generic
System.map-6.8.0-45-generic
vmlinuz-6.8.0-45-genericYour versions will differ, and there may be several sets.
What each file is
vmlinuz-...is the bootable, compressed kernel image that the boot loader loads.initrd.img-...is the initramfs: a small temporary root filesystem in memory with the drivers and tools needed to reach the real root filesystem.System.map-...is a table of kernel symbol names and addresses, used for debugging.config-...records the options chosen when the kernel was built.
Differences between distributions
Fedora and RHEL family systems call the second file initramfs-<version>.img. Arch uses unversioned names such as vmlinuz-linux and initramfs-linux.img. Some setups that use systemd-boot or unified kernel images keep these files on the EFI system partition in other places.
You can search the options of your kernel:
grep CONFIG_EXT4_FS= /boot/config-$(uname -r)CONFIG_EXT4_FS=yy means built into the kernel, and m means built as a module. If the file is missing, some systems provide the same information in /proc/config.gz.
Modules
Loadable modules are not in /boot. They are under a directory named after the kernel release:
ls /lib/modules/$(uname -r)kernel modules.alias modules.depThe list is shortened. On many current systems /lib is a link to /usr/lib.
Which file was booted?
cat /proc/cmdlineBOOT_IMAGE=/boot/vmlinuz-6.8.0-45-generic root=UUID=3f1c9a2e-7b4d-4c1a-9e0f-2a6b8c5d1e44 ro quietThis is the command line given to the kernel. BOOT_IMAGE is added by GRUB, so other boot loaders may not show it.
A container uses the host's kernel, so do not expect to find that kernel in the container's /boot. Never delete files from /boot by hand to free space. Remove old kernel packages with the package manager instead. The search and archives lab helps you practise finding files.
Try it
- Run
ls -lh /bootand compare the sizes. - Run
uname -rand find the files with the same version. - Run
df -h /bootto check free space. - Run
cat /proc/cmdlineand identify the root setting.
Check your understanding
Where the kernel lives
All 4 sections ยท no timer
Unlimited retries
Questions from every section are combined into one assessment. Answer them all correctly to complete the article.
Your completion saves in this browser. Sign in to sync it to your account.