While examining the procedure to perform an installation with full harddisk encryption, I stumbled over the interesting feature of geli to suspend and resume encrypted devices, which makes it ideal on a laptop/netbook when using suspend-to-RAM:
Unfortunately there seems to be catch with resume when using full harddisk encryption:
The GELI manpage shows the following example:
If it's just not possible to have both (full harddisk encryption / encrypted root AND geli suspend/resume), what would be the safest way to protect all your data AND use geli suspend/resume on a laptop/netbook then? I mean, which filesystems to put in separate partitions for encryption to have it all covered?
Another related issue:
geli manpage said:Suspend device by waiting for all inflight request to finish, clearing all sensitive informations (like keys) from the kernel memory and blocking all further I/O requests until the resume subcommand is executed. This functionality is useful for eg. laptops - when one wants to suspend a laptop, one does not want to leave encrypted device attached. Instead of closing all files and directories opened from a file system placed on an encrypted device, unmounting the file system and detaching the device, the suspend subcommand can be used.
Unfortunately there seems to be catch with resume when using full harddisk encryption:
Any idea if there is any way to overcome that issue? Maybe copy the geli utility to the unencrypted /boot partition and call from there, or is there no way at all to use GELI suspend/resume with full harddisk encryption?geli manpage said:The caller must ensure that executing this subcommand won't try to access suspended device, which will lead to a deadlock. For example suspending device, which contains file system where the geli utility is stored is bad idea.
The GELI manpage shows the following example:
But what exactly happens with processes trying to access the encrypted harddisk after <resume your laptop> BEFORE the encrypted GELI device(s) are resumed? The manpage only tells:geli manpage said:Suspend all geli devices, suspend a laptop, then resume devices one by one after resuming a laptop:
# geli suspend -a
# zzz
<resume your laptop>
# geli resume -p -k keyfile gpt/secret
# geli resume gpt/private
Enter passphrase:
geli manpage said:Any access to the encrypted device will be blocked until the keys are recovered through resume subcommand, thus there is no need to close nor unmount anything.
If it's just not possible to have both (full harddisk encryption / encrypted root AND geli suspend/resume), what would be the safest way to protect all your data AND use geli suspend/resume on a laptop/netbook then? I mean, which filesystems to put in separate partitions for encryption to have it all covered?
Another related issue:
So would it be a bad idea to use onetime encryption for the swap partition in matters of using suspend-to-RAM? Will there be any harm to put the laptop/netbook into suspend mode without suspending the encrypted swap partition first? Which approach for encrypting swap would be the most appropriate to use otherwise in conjunction with suspend-to-RAM?geli manpage said:The suspend subcommand does not work with devices created with the onetime subcommand.