Skip to content

LUKS on debian – quick recipe

This approach do not take LVM into consideration!

  1. Clean badblock and check the disk
    badblocks -c 10240 -s -w -t random -v /dev/sdb
  2. Install software
    apt-get install cryptsetup
  3. Create a partition
    fdisk /dev/sdb
  4. Create encrypted partition
    cryptsetup –verbose –verify-passphrase luksFormat /dev/sdb1
  5. Unlock encrypted partition
    cryptsetup luksOpen /dev/sdb1 disco_cifrado
  6. Create FS within encrypted partition
    mkfs.ext3 -j -m1 -O dir_index,filetype,sparse_super /dev/mapper/disco_cifrado
  7. Mount encrypted partition
    mount /dev/mapper/disco_cifrado /mnt/cifrado
  8. Umount encrypted partition
    umount /mnt/cifrado
  9. Lock encrypted partition
    cryptsetup luksClose disco_cifrado
Published inlinux