Last active
August 29, 2015 14:01
-
-
Save staaldraad/9d010a82cd788db0698e to your computer and use it in GitHub Desktop.
Setup crypt container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#create new file to use as container | |
#dd if=/dev/zero of=/out count=5000k | |
fallocate -l 1G test.img | |
#create luks wrapper | |
cryptsetup -v -y luksFormat /out | |
cryptsetup luksOpen /out cryptname | |
cryptsetup -v status cryptname | |
#make into filesystem | |
mkfs.ext4 /dev/mapper/cryptname | |
#mount it | |
mkdir /media/mountpoint | |
mount /dev/mapper/cryptname /media/mountpoint/ | |
##### To mount in the future.. #### | |
cryptsetup luksOpen /out cryptname | |
mount /dev/mapper/cryptname /media/mountpoint/ | |
#check if mounted | |
df -H | grep cryptname | |
#### To safely dismount #### | |
umount /media/mountpoint | |
cryptsetup luksClose cryptname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment