Using DMCrypt to create, create an encrypted filesystem, mappable and mountable filesystem and mount same.

Using DMCrypt to create an encrypted partition on your thumbdrive.

Remove all partitions from the current ThumbDrive:

parted -s ‘rm 1’ DEVICE

Find partitionable size:

~$ sudo fdisk -l /dev/sdc | grep bytes | head -1 | sed ‘s/^.* \([0123456789]*\) bytes/\1 \/ 1000000/’ | bc
16039

Partition the ThumbDrive:

parted -s ‘mkpart primary 0 16039’ DEVICE

Create the DeviceMapper device:

sudo cryptsetup create NAME DEVICE
passphrase:

Make a filesystem on the mapped device (non-journaled FS’s only):


mke2fs /dev/mapper/NAME

Mount the filesystem where appropriate:


mount /dev/mapper/NAME /map-point