[Image description:
Screenshot of terminal output:

~ ❯ lsblk
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda              8:0    1  62.5M  0 disk  
└─topLuks      254:2    0  60.5M  0 crypt 
  └─bottomLuks 254:3    0  44.5M  0 crypt

/end image description]

I had no idea!

If anyone else is curious, it’s pretty much what you would expect:

cryptsetup -y -v luksFormat /dev/sda
cryptsetup open /dev/sda topLuks
cryptsetup -y -v luksFormat /dev/mapper/topLuks
cryptsetup open /dev/mapper/topLuks bottomLuks
lsblk

Then you can make a filesystem and mount it:

mkfs.ext4 /dev/mapper/bottomLuks
mount /dev/mapper/bottomLuks ~/mnt/embeddedLuksTest

I’ve tested putting files on it and then unmounting & re-encrypting it, and the files are indeed still there upon decrypting and re-mounting.

Again, sorry if this is not news to anyone else, but I didn’t realise this was possible before, and thought it was very cool when I found it out. Sharing in case other people didn’t know and also find it cool :)

81 points

we really ain’t making any jokes on the name of the drives? okay…

permalink
report
reply
48 points

Actually the bottomLuks generates most of the power.

permalink
report
parent
reply
25 points

Speed has everything to do with it.

permalink
report
parent
reply
18 points

Well considdering it was posted by a user with the username “communism” i will assume bottomLuks

permalink
report
parent
reply
11 points

Communism doesn’t have hierarchy tho

permalink
report
parent
reply
9 points

That’s very true.

But Marxist-Leninism (Lemmy.ml), the attempt to make communism practical and achievable and bumbling into fascism, does have a hierarchy.

permalink
report
parent
reply
2 points

Wouldn’t that be Anarchism/ Libertarian Socialism? Communism requires a state which is an implicit hierarchy.

permalink
report
parent
reply
11 points

Yes, perhaps I should have named them outerLuks and innerLuks… oh well lol

permalink
report
parent
reply
60 points

Yeah, LUKS and most block level overlays just don’t care. That’s what good abstraction layers do for you!

You can LUKS on a disk image mounted over SSHFS that itself resides on a Ceph cluster and mounted over iSCSI for all it cares. Is it a block device? Yes? Good to go.

You can even LUKS a floppy if you want. Or a CD.

permalink
report
reply
34 points

You wouldn’t LUKS a floppy?

permalink
report
parent
reply
11 points

I absolutely will, if I can find one

permalink
report
parent
reply

And a suitable reader that my computer knows how to talk to.

permalink
report
parent
reply
6 points

I remember years ago investigating alternatives to VMware vSAN and doing hyperconverged storage clusters in Red Hat with glusterFS in top of a couple of other layers. Feels rickety as heck putting it all together but it works well. Hard sell for “normal” people who expect to hit a Next button and get some pretty graphical chart though.

permalink
report
parent
reply
50 points

It would be good if you wanted to have a system that two people need to be present to unlock. Like those nuke launch locks that need two keys.

permalink
report
reply
36 points

You can also just split the password for a single LUKS into two parts and give one each to the two people :D

permalink
report
parent
reply
9 points

Yeah, you’re right. That’s better.

permalink
report
parent
reply
1 point

But then you know both parts of the password and so must be killed to keep the machine secure

permalink
report
parent
reply
1 point

Ideally you would never have to because you just have the two people come up with their part of the password and then initialise the LUKS partition together. Sorta like a key ceremony

permalink
report
parent
reply
17 points

Tbf this would enforce the order in which the two people decrypt it, which may not be good if you expect these two people to “arrive” asyncrhonously and you don’t want them to have to wait for the other before entering their password/key. But maybe that’s too specific of a use case.

permalink
report
parent
reply
13 points
*

You’re a programmer, aren’t you? Always thinking about those race conditions and edge cases.

permalink
report
parent
reply
8 points

Definitely not professionally lol. I think I’d only want a programming job if I could somehow develop FOSS for a living, which is hard to get a full-time job in. And only to a limited extent as a hobby, though I do enjoy programming and am trying to teach myself more whenever I have the time :)

permalink
report
parent
reply
5 points

Didn’t account for the 2 sticky notes cleverly hidden under they keyboard.

permalink
report
parent
reply
3 points

What about this: Top layer encrypted by Alice Middle layer encrypted by Bob Bottom layer encrypted by Alice

If Alice arrives first, she decrypts the top layer and has to wait for Bob to arrive. She cannot go because she has to decrypt the last layer. If Bob arrives first, he has to wait for Alice to arrive. He cannot go because he hasn’t decrypted anything yet.

Not really a solution but kind of helps.

permalink
report
parent
reply
2 points

That would just mean they both have to wait for each other rather than one having to wait for the other but not vice versa. Worse if you want to reduce the total amount of waiting, I guess better if you want there to be equality in having to wait for the other person lol

permalink
report
parent
reply
1 point

I don’t think that’s how its done. I see where your going with this.

permalink
report
parent
reply
43 points

Never apologize for enjoying the discovery of new things. That’s awesome, enjoy it.

permalink
report
reply
40 points

Now recursively create more layers until you have barely any free space left on the disk, then do some performance benchmarks. ;)

permalink
report
reply

Linux

!linux@lemmy.ml

Create post

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

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

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

Community stats

  • 8.4K

    Monthly active users

  • 6.3K

    Posts

  • 172K

    Comments