brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: lsinitramfs lists what is inside the initramfs of your running kernel

Linux
~/tips/tip-lsinitramfs-list-initramfs-content

lsinitramfs /boot/initrd.img-$(uname -r)

Lists the files in an initramfs image, so you can check a driver is in it.

The initramfs is the small system that runs before your real root filesystem. When a disk or driver does not show up at boot, I want to look inside it instead of rebuilding blindly.

lsinitramfs /boot/initrd.img-$(uname -r)

That lists the content of the image for the kernel you are running. The man page belongs to Debian’s initramfs-tools package, so this is the tool for systems that use it. Add -l for a long listing, with permissions and sizes.

The listing is long, so filter it. Does the image contain the module for your storage controller, or the script you added?

lsinitramfs /boot/initrd.img-$(uname -r) | grep -i nvme

You can also give it several images in one call, for example the current and the previous kernel, and compare the listings.

The caveat from the man page: lsinitramfs cannot deal with multi-segmented initramfs images, except when an early, uncompressed initramfs with system firmware is prepended to the regular compressed one. If the output looks wrong on a machine with early microcode, that is the reason.

The file name depends on your system. Check what is in /boot if the path above does not exist. The man page also points to update-initramfs, mkinitramfs and unmkinitramfs as related tools.

Further reading: lsinitramfs man page

More Linux tips a2query -m rewrite renice -n 10 -p 4242 cat config.yml | xsel -ib xvfb-run -a your-program --some-flag dpkg --get-selections > packages.txt All Linux tips (261) All topics

Link