On Sun, Sep 11, 2022 at 9:56 PM Dale <rdalek1...@gmail.com> wrote: > > I suspect this would happen on its own but I'd like to make sure. I'd > hate to mess up the file system badly on any of my drives or in a worst > case scenario, brick a hard drive with some 1 in a million chance problem. >
I just wanted to comment that LUKS encryption on linux is pretty-much a block-level passthrough. So if your filesystem is journaled and using barriers or syncing to ensure consistency, and you add LUKS to it, then you shouldn't really see any difference in behavior if it is interrupted uncleanly by a power loss. The encryption could add a bit of latency but that shouldn't change much. Of course different filesystems handle interruptions differently, and all those caveats still apply. As far as unmounting goes, you just need to umount the filesystem. umount will block until all writes are synced to disk, and that includes all layers like LVM/LUKS/mdadm/whatever that might be underneath it. If umount returns, then all your data is written to disk and if at that instant you lose power there will be no data loss for that filesystem. I guess if you're using mdadm and you have multiple filesystems not aligned to a stripe boundary, then the raid write hole might still apply, and that is true at anytime whether the filesystem is mounted or not - data on a stripe shared with some other active filesystem could get lost in some situations. Obviously if you lose the key to a LUKS filesystem or if there is some kind of bug in LUKS the use of encryption could hinder data recovery. Beyond that it really shouldn't have any impact on anything. I guess it would also give you more exposure to RAM errors (since that is another code path that stores stuff in RAM). As already discussed, clean shutdowns triggered by NUT/etc are of course best, but the use of LUKS shouldn't change much with the use of a UPS otherwise. -- Rich