this post was submitted on 11 Jan 2025
21 points (95.7% liked)

Linux

48954 readers
811 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Hi,

I'm trying to encrypt the root filesystem / of a raspberry pi 4 device running under Devuan rpi ( custom kernel )

I'm following LUKS on Raspberry Pi 2021 guide

That explain step by step how achieve this.

But the guide use initramfs and my distro seem to use initrd

So the question, is: should I migrate to initramfs ? and how check whats is inside my current initrd

or keep-up with initrd but then how insert the necessary to enable LUKS drive to be mounted by it ( initrd ) ?

Thanks.

you are viewing a single comment's thread
view the rest of the comments
[–] ShortN0te@lemmy.ml 3 points 1 day ago (2 children)

Initramfs and initrd are 2 different things, the problem where the confusion happens is that initrd is deprecated since a few years.

Now, systemd has implemented an interface called systemd-initrd which basically is initramfs.

I guess here is were the confusion lies. Nowadays everything is initramfs even if it called initrd.

The original initrd differs from initramfs, but it is no longer a thing.

Sorry if i came across a little bit snappy have not had a great week so far.

[–] user_naa@lemmy.world 2 points 12 hours ago

Everything is fine. It's always nice to learn something new. Hope you will have better week!

[–] gnuhaut@lemmy.ml 2 points 1 day ago* (last edited 1 day ago) (1 children)

Edit: You are right. I looked it up:

There seems to be an actual technical difference, in the kernel, between an initrd and an initramfs. An initrd is apparently mounted like a normal file system, it's just in RAM instead of a backed by a block device. An initramfs is a tmpfs into which a (usually cpio) archive is extracted into. The initramfs apparently would be preferable generally, because the kernel understands that it's a ramdisk, whereas with an initrd it would go through the block device layer, which would mean it would use more ram: If you read a file from an initrd, the kernel would copy the file to ram (unnecessarily, since it's already in ram) like it would for a filesystem on disk, but for a tmpfs/initramfs, it understands it doesn't need to do that.

From a user's perspective there is no significant functional difference I don't think, and I don't think this relevant to OP's question, that probably has more to do with the userspace tools.

[–] ShortN0te@lemmy.ml 2 points 1 day ago (1 children)

https://en.m.wikipedia.org/wiki/Initial_ramdisk

In Linux systems, initrd (initial ramdisk) is a scheme for loading a temporary root file system into memory, to be used as part of the Linux startup process. initrd and initramfs (from INITial RAM File System) refer to two different methods of achieving this. Both are commonly used to make preparations before the real root file system can be mounted.

As i said 2 different things, initrd was used to create a ramdisk, a block device. Initramfs basically directly offers a filesystem instead of a block device.

systemd has now a interface called systemd-initrd: https://github.com/systemd/systemd/blob/main/docs/INITRD_INTERFACE.md

initrd was deprecated see here: https://lkml.org/lkml/2020/7/14/1508

[–] gnuhaut@lemmy.ml 2 points 1 day ago* (last edited 1 day ago)

Yes, sorry, you are correct. I've edited my other comments.