Encrypt USB Flash Drive Using dm-crypt

January 31, 2019


List devices:

blkid -o list
Encrypt and set passcode, make a filesystem, and mount:
sudo cryptsetup --type plain -v open /dev/sdc1 usb_1
sudo mkfs -t ext4 /dev/mapper/usb_1
sudo mount -t ext4 /dev/mapper/usb_1 mnt
Unmount and close:
sudo umount /dev/mapper/usb_1
sudo cryptsetup close usb_1 
To reopen:
sudo cryptsetup --type plain -v open /dev/sdc1 usb_1
Enter passcode and then mount:
sudo mount -t ext4 /dev/mapper/usb_1 mnt

Comments

©2013-2019 All Rights Reserved.