Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New guide: Regenerate initramfs #2478

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/guides/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 48 additions & 0 deletions docs/guides/kernel/regenerate_initramfs.md
Original file line number Diff line number Diff line change
@@ -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!
Loading