1.6 KiB
1.6 KiB
Linux+ 1.2.1: Kernel modules and the initrd
Looking at modules, loading one with an option, loading it at every boot, and finding the root disk's driver in the initrd.
Before you start
The lab unloads the dummy module, a harmless one that makes network
devices. Reboot when task 3 says so; the check looks at the running system.
Tasks
- Find the license of the
xfsmodule and write it to/root/lab-answers/1. - Load
dummywith the optionnumdummies=3, check that it made three devices, and unload it again. Not graded:ip -br link show type dummy | wc -lshould print3before you unload it. - Make
dummyload at every boot with the optionnumdummies=1, then reboot. After the reboot,ip -br link show type dummyshows exactly one device. Keep your files until you've runle-lab check; reset removes them. - Look inside your initrd, and find the driver for your root disk
(
virtio_blk,nvmeorahci, for example). Write its name to/root/lab-answers/4.
Hints
lsmod,modinfo xfs,modinfo -F license.modprobe dummy numdummies=3,modprobe -r dummy./etc/modules-load.d/for loading,/etc/modprobe.d/for options. Files in everymodprobe.ddirectory are read in name order and the last setting wins;modprobe --show-depends dummyshows what modprobe will pass.lsinitrdon the RHEL family,lsinitramfs /boot/initrd.img-$(uname -r)on Ubuntu, which buildsvirtio_blkinto the kernel:grep virtio_blk /lib/modules/$(uname -r)/modules.builtin.lsblkshows the root disk.