boot on LUKS encrypted drive ( initramfs Vs initrd ) ?
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.
LUKS on Raspberry Pi
Guide to perform a full disk encryption of the SD Card of a Raspberry Pi running Raspberry Pi OSLUKS-on-Raspberry-Pi
This entry was edited (11 months ago)
user_naa
in reply to SpongeB0B • • •update-initramfscommand available?ShortN0te
in reply to user_naa • • •user_naa
in reply to ShortN0te • • •ShortN0te
in reply to user_naa • • •Let Me DuckDuckGo That For You - LMDDGTFY
lmddgtfy.netuser_naa
in reply to ShortN0te • • •Based on first result
Since on all modern system initial filesystem is tmpfs sometimes it is confused and initramfs is called initrd (for example: in grub to load initramfs you use
initrdcommand).ShortN0te
in reply to user_naa • • •user_naa
in reply to ShortN0te • • •But I have initramfs packed with dracut in /boot folder
ShortN0te
in reply to user_naa • • •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.
gnuhaut
in reply to ShortN0te • • •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
in reply to gnuhaut • • •en.m.wikipedia.org/wiki/Initia…
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:
github.com/systemd/systemd/blo…
initrd was deprecated see here: lkml.org/lkml/2020/7/14/1508
systemd/docs/INITRD_INTERFACE.md at main · systemd/systemd
GitHubgnuhaut
in reply to ShortN0te • • •user_naa
in reply to ShortN0te • • •gnuhaut
in reply to SpongeB0B • • •So, firstly, about the nomenclature: initrd (initial ram disk) and initramfs (initial ram file system) are usually used interchangeably as far as I know. For example, even though my Debian uses
initramfs-tools, the generated images are called/boot/initrd.img-*. (Edit: There is a technical difference but an initramfs may be referred to as an initrd (like in this case) due to how similar they are.)For example, when installing a kernel,
aptshows this output on my Debian machine:What you're talking about is probably the software used to generate this initial ramdisk, which on Debian is done using
initramfs-tools(which contains themkinitramfscommand), while on other distrosdracut(command:mkinitrd) might be used.I will say it strikes me as weird that Devuan doesn't use
... show moreSo, firstly, about the nomenclature: initrd (initial ram disk) and initramfs (initial ram file system) are usually used interchangeably as far as I know. For example, even though my Debian uses
initramfs-tools, the generated images are called/boot/initrd.img-*. (Edit: There is a technical difference but an initramfs may be referred to as an initrd (like in this case) due to how similar they are.)For example, when installing a kernel,
aptshows this output on my Debian machine:What you're talking about is probably the software used to generate this initial ramdisk, which on Debian is done using
initramfs-tools(which contains themkinitramfscommand), while on other distrosdracut(command:mkinitrd) might be used.I will say it strikes me as weird that Devuan doesn't use
initramfs-toolssince it's a Debian derivative. Maybe you are mistaken about this? Possibly no initrd/initramfs is used at all on this specific Pi version of Devuan? IDK.Edit: See my other comment. I'm wrong. There is an actual technical difference between initrd and initramfs, but I don't think that's actually relevant in this situation. Or rather, both are functionally the same, so it doesn't really matter from the perspective of the user or distro that there's a difference. I will keep the rest of the comment as is, since I do reckon OP's problem is unrelated to this difference, and that probably something else is tripping up OP.
user_naa
in reply to gnuhaut • • •[Ceres] apt: initramfs-tools post-installation error [SOLVED] / Other Issues / Dev1 Galaxy Forum
dev1galaxy.org