From 27c3c3d629d7ebeec7c58364f7e83a7c61dbac58 Mon Sep 17 00:00:00 2001 From: Neel Chauhan Date: Tue, 5 Nov 2024 11:17:32 -0500 Subject: [PATCH] New guide: Regenerate initramfs (#2478) Also add `kernel` section. --- docs/guides/.pages | 1 + docs/guides/kernel/regenerate_initramfs.md | 48 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 docs/guides/kernel/regenerate_initramfs.md diff --git a/docs/guides/.pages b/docs/guides/.pages index d8b59330c6..74945bbcd1 100644 --- a/docs/guides/.pages +++ b/docs/guides/.pages @@ -21,6 +21,7 @@ nav: - File Sharing Services: file_sharing - Hardware: hardware - Interoperability: interoperability + - Kernel: kernel - Mirror Management: mirror_management - Network: network - Package Management: package_management diff --git a/docs/guides/kernel/regenerate_initramfs.md b/docs/guides/kernel/regenerate_initramfs.md new file mode 100644 index 0000000000..7a947fe15f --- /dev/null +++ b/docs/guides/kernel/regenerate_initramfs.md @@ -0,0 +1,48 @@ +--- +title: Regenerate initramfs +author: Neel Chauhan +contributors: +tested_with: 9.4 +tags: + - hardware +--- + +# Regenerate initramfs + +## Introduction + +An `initramfs` is the root filesystem inside a Linux kernel to help boot the system. It contains the core modules needed to boot Linux. + +Sometimes, an Linux administrator might want to regenerate the `initramfs`, say if they want to blacklist a driver or include a out-of-band module. For instance, the author did this to [enable Intel vPro on a Minisforum MS-01](https://spaceterran.com/posts/step-by-step-guide-enabling-intel-vpro-on-your-minisforum-ms-01-bios/). + +## Requirements + +The following are the minimum requirements for using this procedure: + +* A Rocky Linux system or virtual machine (not a container) + +* Changes to the kernel setup, such as blacklisting or adding a module + +## Regenerating the `initramfs` + +To regenerate the `initramfs` you should first back up the existing `initramfs`: + +```bash +cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-$(date +%m-%d-%H%M%S).img +``` + +Next, run `dracut` to regenerate the `initramfs`: + +```bash +dracut -f /boot/initramfs-$(uname -r).img $(uname -r) +``` + +Subsequently, reboot: + +```bash +reboot +``` + +## Conclusion + +The Linux kernel is extremely powerful and modular. It makes sense that some users may want to allow or disallow certain modules, and regenerating the `initramfs` allows for this to happen. So cheers, you regenerated yours!