LUKS / dm-crypt and FS images

LUKS / dm-crypt is also suitable for creating FS images that can be used to store important information:

1
2
3
4
5
6
7
8
9
10
11
12
# dd if=/dev/urandom of=luks.img bs=1M count=100
# losetup /dev/loop0 luks.img
# cryptsetup luksFormat /dev/loop0 -c aes-cbc-essiv:sha256 -s 256
( or -c aes-xts-plain )
WARNING!
========
This will overwrite data on /dev/loop0 irrevocably

# cryptsetup luksOpen /dev/loop0 luks
# mkfs.ext2 /dev/mapper/luks
# mkdir /mnt/luks
# mount /dev/mapper/luks /luks
Scroll to top