-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdm-crypt.txt
27 lines (24 loc) · 954 Bytes
/
dm-crypt.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# dm-crypt/Device encryption
https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption
1.dm-crypt kernel module configure.
$ sudo modprobe dm-crypt
$ sudo dmsetup targets
crypt v1.10.0
mirror v1.12.0
striped v1.5.6
linear v1.1.0
error v1.2.0
2.encrypting devices with cryptsetup.
$ sudo dd if=/dev/zero of=~/secret.img bs=1M count=100
$ sudo losetup /dev/loop0 ~/secret.img
$ sudo cryptsetup -y create myEncryptedFilesystem /dev/loop0
$ sudo dmsetup ls
myEncryptedFilesystem (221, 0)
$ sudo mkfs.ext3 /dev/mapper/myEncryptedFilesystem
$ sudo mkdir /mnt/myEncryptedFilesystem
$ sudo mount /dev/mapper/myEncryptedFilesystem /mnt/myEncryptedFilesystem
$ df -h /mnt/myEncryptedFilesystem
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/myEncryptedFilesystem 97M 2.1M 90M 2% /mnt/myEncryptedFilesystem
$ sudo umount /mnt/myEncryptedFilesystem
$ sudo cryptsetup remove myEncryptedFilesystem