Notes for LUKS partition

10 06 2016

Install requisites:
apt-get install cryptsetup

Create encrypt partition:
cryptsetup -y -v luksFormat /dev/sdX

Create filesystem inside encryp partition:
cryptsetup luksOpen /dev/sdX backupdisk
mkfs.ext4 /dev/mapper/backupdisk

Mount LUKS partition:
cryptsetup luksOpen /dev/sdX backupdisk
mount /dev/mapper/backupdisk /mnt/backupdisk/

Umount LUKS partition:
umount /mnt/backupdisk/
cryptsetup luksClose backupdisk

Change password:
cryptsetup luksDump /dev/sdX
cryptsetup luksAddKey /dev/sdX

Remove password:
cryptsetup luksRemoveKey /dev/sdX

Check mapping status:
cryptsetup -v status backupdisk

Dump headers, for backup:
cryptsetup luksDump /dev/sdX




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: