
How to Encrypt a Disk or Partition With LUKS the Right Way
Encrypt a disk or partition on Linux with LUKS and cryptsetup: format, open, make a file system, back up the header, add a key, and decrypt at boot.
Tag
7 posts

Encrypt a disk or partition on Linux with LUKS and cryptsetup: format, open, make a file system, back up the header, add a key, and decrypt at boot.

Check and repair a Linux file system with fsck without making it worse: unmount first, read-only dry run, ext4 and XFS tools, and what lost+found holds.

Reduce disk IO in scripts: write once instead of in a loop, batch work, keep temp files in memory, sort with a big buffer and count syscalls.

Debug a full disk or exhausted inodes: df and the inode report, find the big directories, spot deleted files still open and reclaim space safely.

Mount an ISO or disk image on Linux with a loop device: read-only by default, expose the partitions of a full image, and unmount without leaving loop devices.

Compare ext4, XFS and Btrfs on Linux: snapshots, checksums, resizing, performance, repair tools and a plain recommendation by workload.

Use tmpfs and RAM disks on Linux: mount one, size it, use /dev/shm and /tmp safely, and understand how memory pressure and swap affect the data.