1 |
On Sat, Jul 4, 2020, at 04:23, Dale wrote: |
2 |
> Now that I have a spare drive, I want to encrypt it and have a mount point for it, /home/dale/documents for example. What I'd like to do, when I login in, it asks me for the encryption password and then mounts it. When I log out, it reverses. I'm not doing all of /home because I want to separate some info. I may do it later. |
3 |
|
4 |
I would use LUKS (warning: all data on the spare drive will be lost): |
5 |
0. Partition the spare drive: parted /dev/sdx |
6 |
1. Format the drive's partition with LUKS: cryptsetup luksFormat /dev/sdxn |
7 |
2. Decrypt the LUKS partition: cryptsetup luksOpen /dev/sdxn documents |
8 |
3. Create a filesystem on the decrypted partition: mke2fs -t ext4 -m 0 /dev/mapper/documents |
9 |
4. Add the new filesystem to /etc/fstab (use the UUID for easier matching) |
10 |
5. Mount the filesystem: mount /home/dale/documents |
11 |
|
12 |
In order to close the filesystem, you need the following steps: |
13 |
1. Unmount the filesystem: umount /home/dale/documents |
14 |
2. Lock the LUKS partition: cryptsetup luksClose documents |
15 |
|
16 |
Since you use KDE you may try Vault instead, but I haven't tested that personally. |
17 |
|
18 |
-- |
19 |
https://fturco.net/ |