Do you encrypt your data drives?
from peregus@lemmy.world to selfhosted@lemmy.world on 16 Apr 2024 21:15
https://lemmy.world/post/14370423

Fellow selfhoster, do you encrypt your drives where you put data to avoid privacy problems in case of theft? If yes, how? How much does that impact performances? I selfhost (amongst other services) NextCloud where I keep my pictures, medical staff, …in short, private stuff and I know that it’s pretty difficult that a thief would steal my server, buuut, you never know! 🤷🏻‍♂️

#selfhosted

threaded - newest

wildbus8979@sh.itjust.works on 16 Apr 2024 21:20 next collapse

Yes of course, with dm-crypt (luks), very little as AES-NI is incredibly fast.

peregus@lemmy.world on 17 Apr 2024 11:44 collapse

Do you insert the key/password manually every time (it’s a server, so not so many times, but could happen) you boot the server?

Akinzekeel@lemmy.world on 18 Apr 2024 06:47 collapse

cyberciti.biz/…/how-to-unlock-luks-using-dropbear…

As mentioned in another comment I haven’t quite gotten it working but it should be possible to do this via SSH

mouse@midwest.social on 16 Apr 2024 21:31 next collapse

It’s a relatively low performance hit and it benefits me when having to replace a failing/old disk. I can just toss the drive without having to erase the data first, that is as long as the key is a secure length.

acockworkorange@mander.xyz on 16 Apr 2024 21:35 next collapse

No. If someone gets to my server that’ll be the least of my worries.

ShortN0te@lemmy.ml on 16 Apr 2024 21:44 next collapse

I use full disk encryption for every server (and other computers).

Encrypting your data drives is a must for everyone imho. Encrypting the OS is a must for me🤷‍♂️

n3m37h@lemmy.dbzer0.com on 16 Apr 2024 23:48 collapse

My PC weighs 80+ lbs, live 8km from town, surrounded by farm land and there are only 3,400 in town and I live 30 min from a city of 40,000 and 40 min from another city of 70,000 and my internet is 20/10 mbps

EinfachUnersetzlich@lemm.ee on 17 Apr 2024 05:19 collapse

What’s your point?

JustEnoughDucks@feddit.nl on 17 Apr 2024 06:20 next collapse

I think he is saying that his physical attack surface is very small since he is remote, so maybe he doesn’t bother?

Either way, encrypting drives is simply always good if you ever resell the computer or upgrade drives.

n3m37h@lemmy.dbzer0.com on 17 Apr 2024 11:25 collapse

FreeAin’t no one stealing my shit, even via internet to upload 40tb would take 1 year 5 days at max speed in actuality it would be 1 year 8 months… Fuck I miss my 1.5G fibre connection…

sznowicki@lemmy.world on 16 Apr 2024 22:00 next collapse

I keep my drives encrypted with a key currently hosted in my router hoping they wouldn’t steal that. I’m thinking of actually putting it to cloud so I can disable it remotely.

It was quite a ride to make everything work and I made a blog post explaining it so I remember what I did.

nowicki.io/self-hosting-lvm-raid1-with-key-over-f…

peregus@lemmy.world on 17 Apr 2024 12:08 collapse

Interesting, thanks!

d3Xt3r@lemmy.nz on 16 Apr 2024 22:05 next collapse

This shouldn’t even be a question lol. Even if you aren’t worried about theft, encryption has a nice bonus: you don’t have to worry about secure erasing your drives when you want to get rid of them. I mean, sure it’s not that big of a deal to wipe a drive, but sometimes you’re unable to do so - for instance, the drive could fail and you may not be able to do the wipe. So you end up getting rid of the drive as-is, but an opportunist could get a hold of that drive and attempt to repair it and recover your data. Or maybe the drive fails, but it’s still under warranty and you want to RMA it - with encryption on, you don’t have to worry about some random accessing your data.

kabi@lemm.ee on 16 Apr 2024 23:51 next collapse

If you’re getting rid of a (rusty) drive and it leaves your hands with the cool magnets and shiny frisbees still inside, you’re doing something wrong.

trolololol@lemmy.world on 18 Apr 2024 07:30 collapse

Dude just use a hammer

pHr34kY@lemmy.world on 16 Apr 2024 22:46 next collapse

I did have LUKS and a USB flash drive with a key to be inserted on boot. It was definitely difficult and caused performance issues. It was particularly difficult to add/remove drives from the array. These days I only encrypt my off-site backups that sit at the office where my coworkers potentially have physical access.

There have been recent advancements in TPM so disk encryption is easier to maintain and doesn’t affect performance. I’ll need to investigate this one day. My server/NAS is a 4th-gen i5, so it may not support the functions I would need. Full disk encryption will land in Ubuntu soon. I’m hanging out for that.

asbestos@lemmy.world on 16 Apr 2024 23:12 next collapse

How do you even encrypt a server so that it doesn’t require human intervention every time it goes down/restarts?

Dalraz@lemmy.ca on 16 Apr 2024 23:21 next collapse

Isn’t that what a TPM could be used for?

umbrella@lemmy.ml on 18 Apr 2024 05:31 collapse

i dunno is it? how to set that up?

ClemaX@lemm.ee on 16 Apr 2024 23:27 next collapse

Files could be decrypted by the end user. The OS itself could remain unencrypted.

bjoern_tantau@swg-empire.de on 16 Apr 2024 23:37 next collapse

I’m too lazy to look up the details. But you can have a small ssh server running as part of initrd. I think it’s dropbear. I log into that and unlock the root drive from there.

Of course that necessitates an unencrypted /boot/.

Did it on Debian and it was relatively easy to set up.

Akinzekeel@lemmy.world on 18 Apr 2024 06:42 collapse

I‘m in the process of setting up a new NAS with Debian and disk encryption, and this is exactly what I’m struggling with. I’ve tried multiple guides for Dropbear but every time I try to SSH into the server to unlock it, I get “Permission denied”.

bjoern_tantau@swg-empire.de on 18 Apr 2024 07:16 next collapse

I don’t reboot my server that often. But I think I use a dedicated port and key for it. I don’t use them anywhere else. Maybe the key has to be a specific format for Dropbear.

ShortN0te@lemmy.ml on 18 Apr 2024 15:12 collapse

This answer here covers it quite nice imo.

unix.stackexchange.com/…/ssh-to-decrypt-encrypted…

Important is that you update your initramfs with the command after you edited the dropbear initramfs config and or you copied the key over.

For the client it is important to define 2 different known hosts files since the same host will have 2 different host keys, 1 when encrypted with dropbear, and 1 when operational with (usually) sshd.

Also you need to use root when you connect to your server to unlock it. No other user will work with the default setup.

Akinzekeel@lemmy.world on 18 Apr 2024 20:34 collapse

I was actually using my own user account instead of root, but now that you mention it… I’m not sure how that would even work so yeah that makes sense.

I did rebuild the initramfs after every change but did not manually copy the key file anywhere other than etc.

Will check out the link tomorrow. Thanks a lot for sharing!

Edit: tried again with root and it worked flawlessly :D

hperrin@lemmy.world on 17 Apr 2024 04:11 next collapse

TPM, but it’s a pain in the ass and breaks a lot. The new version of Ubuntu should handle it better, but if you’re not on Ubuntu, that won’t help you.

lorentz@feddit.it on 17 Apr 2024 07:53 collapse

TPM solves a sigthly different threat model: if you dispose the hd or if someone takes it out from your computer it is fully encrypted and safe. But if someone steals your whole server it can start and decrypt the drive. So you have to trust you have good passwords and protection for each service you run. depending on what you want to protect for this is either great solution or sub optimal

lorentz@feddit.it on 17 Apr 2024 08:04 next collapse

I remember this blog post (I cannot find right now) where the person split the decryption password in two: half stored on the server itself and half on a different http server. And there was an init script which downloaded the second half to decrypt the drive. There is a small window of time between when you realize that the server is stolen and when you take off the other half of the password where an attacker could decrypt your data. But if you want to protect from random thieves this should be safe enough as long as the two servers are in different locations and not likely to be stolen toghether.

Pika@sh.itjust.works on 17 Apr 2024 14:06 next collapse

TPM is a good way, Mine is setup to have encryption of / via TPM with luks so it can boot no issues, then actual sensitive data like the /home/my user is encrypted using my password and the backup system + fileserver is standard luks with password.

This setup allows for unassisted boot up of main systems (such as SSH) which let’s you sign in to manually unlock more sensative drives.

ShortN0te@lemmy.ml on 17 Apr 2024 22:51 collapse

How do you even encrypt a server so that it doesn’t require human intervention every time it goes down/restarts?

The only time my Server goes down, is when i manually reboot it. So waiting a minute or two, to ssh into it and entering the passphrase is no inconvenience.

brygphilomena@lemmy.world on 17 Apr 2024 00:31 next collapse

Nope. This isn’t part of my threat model.

I don’t have sensitive data and stealing a drive would be inconvenient for a thief.

flork@lemy.lol on 17 Apr 2024 13:13 collapse

You don’t have sensitive data? Would you mind expanding on that a bit for me? Just curious how you like, live, and stuff.

Pika@sh.itjust.works on 17 Apr 2024 13:58 next collapse

I’m surprized as well, like I guess I would understand if it’s a no log DNS server but, what else wouldn’t have sensitive information.

Freeman@lemmings.world on 21 Apr 06:55 collapse

My Music, Movies and Shows, I dont consider them private/sensitive, as they aren’t illegal to possess or even download in my country. I would even donate my filled but corrupted drive to a repair guy, he can have the media if he can repair it.

brygphilomena@lemmy.world on 17 Apr 2024 20:29 collapse

Plex data, pi hole, and home assistant don’t contain anything meaningful. No credentials are stored in a form that can be reused.

The most sensitive is immich, which I’m more concerned about backups than I am someone might steal my nudes. Their online anyway.

Email is hosted off-site and I still have physical files for a lot of my documents. If someone stole hdds out of my server, they’d get a lot of Linux isos, pictures of cars, porn, tons of versioned software and games installers, etc.

Maybe my definition of sensitive is different than yours though.

Kolanaki@yiffit.net on 17 Apr 2024 00:38 next collapse

I don’t do anything that warrants it, but if I did have sensitive data that I was worried about being stolen, those drives would be in a system completely cut off from the Internet to prevent remote theft, and encrypted in the event of a physical theft. If I was especially paranoid, I’d booby trap the drives to wipe themselves if they are tampered with.

StructureOfChaos@lemmynsfw.com on 17 Apr 2024 00:48 next collapse

Use Cryptomator to have your data safe from prying eyes.

avidamoeba@lemmy.ca on 17 Apr 2024 01:30 next collapse

Have you tried secure-erasing a disk?

Absolutely yes, I do enctypt my drives so I don’t have to ever do that again. This isn’t as critical for SSDs but it’s still a good idea. Even if you keep the key stored on the same system, securely deleting a tiny file is way easier than a whole disk.

MonkderDritte@feddit.de on 17 Apr 2024 08:36 collapse

Have you tried secure-erasing a disk?

Once /dev/urandom is enough. Who cares if a state actor could theoretically recover your media library in an expensive lab.

avidamoeba@lemmy.ca on 17 Apr 2024 14:16 collapse

Even that takes a while.

h3ndrik@feddit.de on 17 Apr 2024 22:30 collapse

And it has other benefits. For example a dying disk. You can just throw that out. I once tried to wipe such a disk and it’s a chore. It makes weird clicking noises and slows down to the point where it’d take years to overwrite it. Occasionally the SATA controller resets etc. And it won’t succeed at overwriting stuff. Sure I could go to the garage, get the power tools, put the hdd into a vise and delete everything with a combination of hammer and drill… But it’s much more convenient to have it encrypted and not care.

AnUnusualRelic@lemmy.world on 17 Apr 2024 23:24 collapse

You take the disk out, drill once through it (use a metal bit).

Done.

Takes a couple minutes.

h3ndrik@feddit.de on 18 Apr 2024 05:21 next collapse

Sure. It’s just effort. I have to go fetch the power tools, fetch the drills, if I want to do it correctly also mount a vise or go fetch a piece of scrap wood and some clamps… After that clean up and remove the metal chips from my apartment…

At work I’d additionally need 3 training courses to be allowed to operate the drill press and visit the workshop. The whole process is going to take half a year. And it’ll still not be certified that the information is now gone.

AnUnusualRelic@lemmy.world on 18 Apr 2024 18:33 collapse

In an enterprise setting, it’s probably a bit of a hassle with everything having to follow some kind of process…

h3ndrik@feddit.de on 18 Apr 2024 19:58 collapse

Somehow they don’t trust the software developers with operating heavy machinery 😆

Anyways, I think we’re moving away from the topic… At work I didn’t encrypt harddisks anyways. They just put the servers into a special area in the datacenter that has a fence and a separate lock.

At home I just encrypt stuff so I don’t have to remember what I put where and handle things differently. Of course everything depends on the specific scenario and threat model. I have a bit of stuff archived on my server that isn’t around anymore, could be a copyright violation. I also have my complete life stored there, documents, finances, emails of a decade, pictures, backups for family members, passwords for emergency access to things. Admin stuff and logfiles that I’m required by law (GDPR…) not to share. I also used to travel a lot with my laptop in the backpack and that can get stolen. At some point a long time ago I decided to encrypt my harddisks and stop worrying. Since at least 10 years there isn’t any speed penalty anymore and it takes like 20 seconds to set it up on Linux…

But I can also see why not everyone wants to do it this way.

AnUnusualRelic@lemmy.world on 19 Apr 14:31 collapse

I’m still in the planning stage of my home network (we’re redoing the whole place so I’m doing a proper network) and TrueNas will be at the centre of it. So far, I’m not considering encryption (my laptops have /home encrypted though).

I’m not sure what the risk of a Disney raid on my server is. It could be a real thing, or not. It really depends on many things.

However, all in all, the lack of a proper solution for a quick server wipe beyond the usual thermite load, is problematic.

h3ndrik@feddit.de on 19 Apr 15:00 collapse

Why don’t you consider encrypting your NAS, if I might ask? Inconvenience on boot? Because that’s one inconvenience I currently live with… After a power outage I have to fetch a keyboard and type in the password, since the mainboard doesn’t have remote-management and I’ve never set up an automatic way to transfer/fetch the encryption key…

AnUnusualRelic@lemmy.world on 19 Apr 15:03 collapse

ZFS is already a handful. I’m not sure if I want to add encryption on top of that.

h3ndrik@feddit.de on 19 Apr 15:33 collapse

Fair enough.

AnUnusualRelic@lemmy.world on 19 Apr 16:30 collapse

In truth, I’m going to have to deal with a shitload of new stuff. I’m going with a Dell or Supermicro server (as in rackable server) with between 8 and 16 disks, so I’m also going to have to deal with new hardware (I suppose everyone kind of has to, since they’re not running their usual software). And of course, I’m also doing HomeAssistant stuff on top of that, with all the Zigbee (or whatever other proper protocols I can stick on MTQQ) stuff, or else where would the fun be.

It’s a good thing I’ve been managing Unix stuff for decades (not that it makes me feel any better about juggling a dozen new things at the same time).

h3ndrik@feddit.de on 19 Apr 18:10 collapse

Oh wow. Seems you live somewhere where electricity is a bit more affordable. I have an super efficient enterprise mainboard with an old Xeon. I get by with the 6 SATA-Ports for home use. I mean now that we have 12TB drives… I bought lots of RAM an I’m running several VMs, containers, Home Assistant and all sorts of stuff on that machine.

Happy tinkering and learning?!

24_at_the_withers@lemmy.world on 19 Apr 03:07 collapse

Takes me about 2 seconds with a 5lb steel mallet.

AnUnusualRelic@lemmy.world on 19 Apr 14:33 collapse

Bold of you to assume sysadmins can wield a 5lb mallet. (I’m not completely sure what that is in real world weight, 2 ½ kg?).

hperrin@lemmy.world on 17 Apr 2024 04:17 next collapse

I have two WebDAV shares, one unencrypted and one encrypted. The unencrypted one is for things that need to be read by other services, like legally obtained movies and tv shows. The encrypted one is for porn, mostly (also stuff like tax documents, legal contracts, etc).

This is the server I use

hub.docker.com/r/sciactive/nephele

It’s really easy to set it up for encryption. Also, I wrote it. :)

z00s@lemmy.world on 17 Apr 2024 05:45 collapse

Do you honestly encrypt your porn? Why? (Assuming it’s legal)

markstos@lemmy.world on 17 Apr 2024 11:53 next collapse

How are you certain all your porn is legal?

z00s@lemmy.world on 17 Apr 2024 13:18 collapse

I think we both understand the intention behind my statement

h3ndrik@feddit.de on 17 Apr 2024 22:20 collapse

Good question. I don’t have a clue either. It doesn’t contain any personal information. (Unless it’s self-made.) Usually isn’t unique. And nobody cares as there’s an abundance of porn available everywhere on the internet.

BastingChemina@slrpnk.net on 17 Apr 2024 05:47 next collapse

No,

There is all the backup of all my family pictures in the drives.

If something happens to me I want to make due that they will have access to it.

JoeKrogan@lemmy.world on 17 Apr 2024 06:41 next collapse

On laptops yes, on my server no. Most of the data is photo backups and linux ISOs form over the years.

h3ndrik@feddit.de on 17 Apr 2024 08:13 next collapse

Yes.

I encrypt about everything. Laptop, server, backups, external hdds that are just for me. (Only thing I don’t encrypt is a VPS. It’s hosted on somebody else’s hardware and they’d be able to break the encryption anyways if they wanted.)

I just put LUKS on it before formatting a filesystem. For the OS I use the good old approach with LUKS and a LVM inside.

I mean if you don’t encrypt the backups, the encrytion of the system is kind of meaningless, isn’t it?

redxef@feddit.de on 17 Apr 2024 08:16 next collapse

Always, if nothing else it makes “wiping” them securely easier.

Decronym@lemmy.decronym.xyz on 17 Apr 2024 08:25 next collapse

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
LVM (Linux) Logical Volume Manager for filesystem mapping
MQTT Message Queue Telemetry Transport point-to-point networking
NAS Network-Attached Storage
NFS Network File System, a Unix-based file-sharing protocol known for performance and efficiency
Plex Brand of media server package
SATA Serial AT Attachment interface for mass storage
SSD Solid State Drive mass storage
SSH Secure Shell for remote terminal access
VPS Virtual Private Server (opposed to shared hosting)
ZFS Solaris/Linux filesystem focusing on data integrity
Zigbee Wireless mesh network for low-power devices

12 acronyms in this thread; the most compressed thread commented on today has 7 acronyms.

[Thread #686 for this sub, first seen 17th Apr 2024, 08:25] [FAQ] [Full list] [Contact] [Source code]

Gooey0210@sh.itjust.works on 17 Apr 2024 09:40 next collapse

Yes, all, no matter what data is, it’s not hard and doesn’t have any consequences, but protects from many inconvenient accidents

markstos@lemmy.world on 17 Apr 2024 11:57 next collapse

In addition to “encryption at rest”, also consider that your devices might be exploited over the internet, so attackers may be able to access the decrypted state that way. To guard against that, you may wish to encrypt certain documents with an additional password, even if they are sitting on an encrypted file system.

Recall that within a month, the widely SSH was exploited and a backdoor added to every machine. I had upgraded to that SSH version. I didn’t run an SSH server on that box, but it goes to show that even those who take precautions can end up exploited!

possiblylinux127@lemmy.zip on 17 Apr 2024 14:43 next collapse

The XZ vulnerability was stopped in its tracks and did not really affect the majority of systems.

I also have a hard time believing local file encryption can be that effective. All they need to do is capture your keystrokes.

markstos@lemmy.world on 17 Apr 2024 21:34 collapse

It’s defense in depth. If I encrypt a rarely used file, capturing my keystrokes will eventually work, but it might be weeks or months before I return to decrypt that file. In the meantime, I might have realized I was hacked and restore the system.

peregus@lemmy.world on 18 Apr 2024 07:05 collapse

That’s why I use most of the services via Wireguard (except Nextcloud that is behind Cloudflare and MQTTs that’s completely exposed)

possiblylinux127@lemmy.zip on 17 Apr 2024 14:41 next collapse

I encrypt devices that are portable. If someone raids my house I have bigger fish to fry.

peregus@lemmy.world on 18 Apr 2024 07:03 collapse

If someone raids my house I have bigger fish to fry. Sure, but if it’s “free”, why not do it? My main worry was about performances, but since I’ve read that with AES-NI it doesn’t impact that much and since it seems not to be that complicated (let’s hope! 😁).

Smash@lemmy.self-hosted.site on 17 Apr 2024 20:14 next collapse

No

pyrosis@lemmy.world on 17 Apr 2024 20:54 next collapse

Yup and negligible. If I’m forced to contend with a windows environment bitlocker is utilized.

I also utilize a ram disk in a windows os. Imdisk in windows. I migrate temp files and logs into the ram disk. It saves on disk writes and increases privacy.

If pretty straightforward to encrypt if utilizing Linux right from install time.

As for my server I too utilize nextcloud. However, the nextcloud data is on a zfs dataset. This dataset is encrypted.

I did this by installing nextcloud from docker running within a proxmox container. That proxmox lxc container has the nextcloud dataset passed into it.

peregus@lemmy.world on 18 Apr 2024 07:08 collapse

I did this by installing nextcloud from docker running within a proxmox container. That proxmox lxc container has the nextcloud dataset passed into it.

That’s almost what I’m doing (I’m using a VM in Proxmox where I install all my Docker containers). Right now I’m thinking about encrypt only the data volume (a NFS share from Proxmos host) since all the sensible data will be there.

AtariDump@lemmy.world on 17 Apr 2024 21:54 next collapse

I used to until I realized that I’ve got bigger threats to worry about.

And like someone else mentioned, if I have to do data recovery for some unknown reason I want to make sure the data’s not encrypted.

peregus@lemmy.world on 18 Apr 2024 07:00 collapse

Why? If you store the key in your password manager shouldn’t be a problem to mount the drive on another PC, decrypt it and save data. Or am I missing something?

onlinepersona@programming.dev on 18 Apr 2024 07:07 collapse

Recovering data from a corrupted, encrypted drive is way trickier than from a simply corrupted drive, I imagine.

Anti Commercial-AI license

peregus@lemmy.world on 18 Apr 2024 07:14 collapse

Why? What would be the problem?

P.s. Why did you link to the Anti Commercial-AI license?

onlinepersona@programming.dev on 18 Apr 2024 07:27 next collapse

Why? What would be the problem?

On linux, you’re probably using LUKS. That has a header with the keys at the beginning of each encrypted volume. If those keys (or key if you only have one) is corrupted and you don’t have a backup of that, you’re fucked.

The next problem is that data recovery tools mostly don’t support decryption. They scan regions or the entire drive for recognizable things like partition headers, partition tables, file types, etc. if those are encrypted, well…

If you are able to decrypt a partition, then it might work as it will show up like any other device in /dev/mapper/ and you could do recovery /dev/mapper/HDD. However, I have no idea what data corruption does to encryption algorithms. If one part of what is being decrypted is faulty, what does that do to the entire thing?
This mostly comes from a lack of knowledge on my part. IIRC encryption depends on hashsums -> if you change what’s being decrypted/encrypted, the entire hashsum is incorrect and thus all the data shouldn’t be able to be decrypted. But I might be wrong - I’ll gladly be wrong on this.

Anti Commercial-AI license

peregus@lemmy.world on 18 Apr 2024 07:32 collapse

On linux, you’re probably using LUKS. That has a header with the keys at the beginning of each encrypted volume. If those keys (or key if you only have one) is corrupted and you don’t have a backup of that, you’re fucked.

I got it, thanks! I will rely on SnapRaid form redundancy and on backups on multiple devices/locations.

WolfLink@lemmy.ml on 18 Apr 2024 08:09 collapse

The way you recover data from a totally dead drive is use a program that scans every byte and looks for structures in the data that look like files e.g. a jpeg will have a header followed by some blocks of content. In an encrypted drive everything looks like random data.

Even if you have the key, you can’t begin searching through the data until it’s decrypted, and the kind of error that makes it so your drive won’t mount normally is likely to get in the way of decrypting normally as well.

tills13@lemmy.world on 18 Apr 2024 05:45 next collapse

Anyone who says yes is either a professional in a field already requiring it (is aware of how to do it and what it means), retired (has unlimited time to tinker), or is Edward Snowden. For the average person, you don’t need to encrypt your disks.

peregus@lemmy.world on 18 Apr 2024 06:56 collapse

Well, since I’ve discovered that with AES-NI it doesn’t impact performances, I don’t see why not do it. I’ve had a look at a couple of guides and it doesn’t seem to be so difficult

onlinepersona@programming.dev on 18 Apr 2024 07:14 next collapse

I want to, but haven’t found the time to make a strategy on how to move over the data. It would take a bunch of shuffling as all drives are in use. The next problem is decrypting at boot and securely storing the decryption key - if I choose to use a decryption key at all. Maybe it’ll be a usb key that I have to plug into the server when starting it, or I have to setup decryption of the system over SSH, but that means automated restarts are… difficult.

Not sure how to tackle the problem yet…

rockstarmode@lemmy.world on 18 Apr 2024 21:00 collapse

I use separate disks for data storage and my OS. That way a headless system can boot and all the services like SSH can become available, and I can decrypt the data drives remotely.

When there’s an unexpected reboot I can still get into my system and decrypt remotely which is nice. I can also move the data storage disks to another system without too much hassle.

I did have to make sure some services were fault tolerant if an encrypted volume was unavailable when the OS booted. An example of this might be torrenting software, I needed to make sure the temporary storage was on an encrypted volume. The software had a sane fault mode when the final storage location was unavailable, but freaked out for some reason when the temp storage was missing.

Once set up the whole thing is pretty easy to manage.

onlinepersona@programming.dev on 19 Apr 07:29 collapse

I did have to make sure some services were fault tolerant if an encrypted volume was unavailable when the OS booted

How did you achieve that? systemd dependency?

Anti Commercial-AI license

rockstarmode@lemmy.world on 19 Apr 18:43 collapse

I’m pretty sure I didn’t mess with systemd, though that would probably be the right way to handle it.

I was able to update a runtime config so if any storage wasn’t available it just halted the service. Then I created a short script I’d invoke manually which decrypted the luks drives and brought the dependent services up. I also added monitoring to alert me when the drives weren’t available for whatever reason.

zarenki@lemmy.ml on 18 Apr 2024 15:27 next collapse

Yes.

My home server has dropbear-initramfs installed so that after reboot I can access the LUKS decryption prompt over SSH. The one LUKS partition contains a btrfs filesystem with both rootfs and home as subvolumes. For all the other drives attached to that system, I use ZFS native encryption with a dataset that decrypts with a keyfile from that rootfs and I have backups of an encrypted copy of that keyfile.

I don’t think there’s a substantial performance impact but I’ve never bothered benchmarking.

Unyieldingly@lemmy.world on 18 Apr 2024 20:48 next collapse

on my NAS i do and work data as well.

tired_n_bored@lemmy.world on 18 Apr 2024 22:00 collapse

No. I run my servers on low quality shit and I expect them to break any time. Never had to perform a data recovery but if I need, I’ll thank myself I didn’t encrypt my pics

Kcg@lemmy.ml on 19 Apr 18:38 collapse

Power user move!