LUKS Encrypted Container

馃拪 Quick Pill: LUKS Encrypted Container 鈩癸笍Info Use case: Create encrypted file containers for secure backup storage, sensitive documents, or portable encrypted volumes. Works like a virtual encrypted disk. 馃攼 Quick Setup (5 minutes) 1. Install Required Tools sudo apt install cryptsetup 2. Create Encrypted Container # Create a 10GB empty file (fast allocation) fallocate -l 10G BackupCrypt.img # Initialize LUKS encryption (you'll set a password) sudo cryptsetup luksFormat BackupCrypt.img # Open the encrypted container sudo cryptsetup open BackupCrypt.img backup_crypt # Create filesystem inside sudo mkfs.ext4 /dev/mapper/backup_crypt # Mount it sudo mkdir -p /mnt/encrypted sudo mount /dev/mapper/backup_crypt /mnt/encrypted # Set permissions (optional - for your user) sudo chown $USER:$USER /mnt/encrypted 3. Use Your Encrypted Storage # Copy files cp -r ~/Documents/sensitive/ /mnt/encrypted/ # Work with files normally echo "Secret data" > /mnt/encrypted/secret.txt 4. Close Encrypted Container # Unmount sudo umount /mnt/encrypted # Close LUKS container sudo cryptsetup close backup_crypt 鉁匰uccess Done! Your data is now encrypted. Without the password, the file looks like random data. 馃攧 Daily Usage Open and Mount # Open with password prompt sudo cryptsetup open BackupCrypt.img backup_crypt # Mount sudo mount /dev/mapper/backup_crypt /mnt/encrypted Close and Lock # Always unmount first sudo umount /mnt/encrypted # Then close sudo cryptsetup close backup_crypt 馃搵 Command Reference Create Container Command Purpose Notes fallocate -l SIZE file.img Create empty file (fast) Sizes: 1G, 10G, 100G, etc. dd if=/dev/zero of=file.img bs=1M count=10240 Create file (slower, more secure) Overwrites with zeros cryptsetup luksFormat file.img Initialize LUKS encryption Sets password Open/Close Command Purpose cryptsetup open file.img name Open encrypted container cryptsetup close name Close encrypted container cryptsetup status name Check if container is open Filesystem Command Purpose mkfs.ext4 /dev/mapper/name Create ext4 filesystem mkfs.xfs /dev/mapper/name Create XFS filesystem mkfs.btrfs /dev/mapper/name Create Btrfs filesystem 馃挕 Pro Tips Create container with dd (more secure, slower) Use dd instead of fallocate for better security - overwrites the file with zeros: ...

October 5, 2025 路 6 min 路 1190 words 路 Manzolo

LUKS Disk Encryption Management Guide (Debian/Ubuntu)

LUKS Disk Encryption Management Guide (Debian/Ubuntu) Introduction LUKS (Linux Unified Key Setup) is a standard for Linux disk encryption that provides a platform-independent way to encrypt block devices, such as partitions or entire disks. It supports multiple passphrases (keys), secure key derivation, and integration with other storage layers like LVM or ZFS. This guide explains how to create, modify, and manage encrypted disks with LUKS on Debian/Ubuntu systems, covering setup, key management, mounting, and maintenance. ...

October 3, 2025 路 5 min 路 989 words 路 Manzolo

Encrypted LVM Disk Resize (LUKS + LVM)

馃拪 Quick Pill: Encrypted LVM Disk Resize 鈩癸笍Info Use case: Expand encrypted Ubuntu/Debian VMs that use LUKS encryption + LVM. Common in full-disk encryption setups. 馃攼 Complete Resize Process (Encrypted + LVM) 鈿狅笍Warning 鈿狅笍 Critical: ...

October 5, 2025 路 10 min 路 2072 words 路 Manzolo