Difference between revisions of "Ubuntu 22.04 LVM encryption using LUKS"

From Notes_Wiki
Line 8: Line 8:


<pre>
<pre>
sudo umount <mount-point>
# sudo umount <mount-point>
</pre>
 
=== Format the Volume with LUKS Encryption ===
Use `cryptsetup` to encrypt the logical volume:
 
<pre>
# sudo cryptsetup luksFormat <lvm-path>
</pre>
 
=== Open the Encrypted Volume ===
Open the LUKS volume and map it to a device name (e.g., `data_crypt`):
 
<pre>
# sudo cryptsetup open <lvm-path> data_crypt
</pre>
</pre>

Revision as of 07:25, 22 July 2025

Home > Ubuntu > Ubuntu 22.04 > Ubuntu 22.04 LVM encryption using LUKS

To configure encryption on an empty LVM logical volume in Ubuntu 22.04 (Also works on Ubuntu 24.04) after OS installation, follow these steps:

Encrypting and Mounting a Logical Volume with LUKS

  • If the logical volume is already mounted, unmount it:
# sudo umount <mount-point>

Format the Volume with LUKS Encryption

Use `cryptsetup` to encrypt the logical volume:

# sudo cryptsetup luksFormat <lvm-path>

Open the Encrypted Volume

Open the LUKS volume and map it to a device name (e.g., `data_crypt`):

# sudo cryptsetup open <lvm-path> data_crypt