创建

 
dd if=/dev/zero of=/window/sda3/good/linux.iso bs=10M count=600 
 
losetup /dev/loop0 /window/sda3/good/linux.iso
 
cryptsetup luksFormat /dev/loop0
 
cryptsetup luksOpen /dev/loop0 linux
 
mkfs.ext4  /dev/mapper/linux
 
mount /dev/mapper/linux  /window/good
 
 
 
 
挂载
 
losetup /dev/loop0 /window/sda3/good/linux.iso
 
cryptsetup luksOpen  /dev/loop0  linux
 
mount /dev/mapper/linux  /window/good
 
 
 
 
卸载
 
umount /window/good
 
cryptsetup luksClose linux
 
 
 
 
开机自动挂载
 
a、vim /etc/fstab
 
           /dev/mapper/linux  /window/good  ext4  defaults 0 0 
 
 
 
b、vim /etc/crypttab
  
           linux  /dev/loop0  /root/cryptsetup/keyfile1  luks
 
 
 
c、dd if=/dev/urandom  of=/root/cryptsetup/keyfile1  bs=4k count=1
 
 
 
d、cryptsetup luksAddKey  /dev/loop0  /root/cryptsetup/keyfile1