Adding an encrypted partition with LUKS

There may be times when you'll need to either add another encrypted drive to an existing machine, or encrypt a portable device, such as a USB memory stick. This procedure works for both scenarios.

To demonstrate, I'll shut down my CentOS VM and add another virtual drive:

I'll bump the drive capacity up to 20 GB, which will give me plenty of room to play with:

After rebooting the machine, I now have a /dev/sdb drive to play with. My next step is to create a partition. It doesn't matter whether I create ...

Get Mastering Linux Security and Hardening now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.