Skip to content

Instantly share code, notes, and snippets.

@hoto
Last active February 8, 2017 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoto/fed93a389bea42a147a9091e72d6b6b3 to your computer and use it in GitHub Desktop.
Save hoto/fed93a389bea42a147a9091e72d6b6b3 to your computer and use it in GitHub Desktop.
lsblk #only the one with 'luks' are encrypted
#NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
#nvme0n1 259:0 0 238.5G 0 disk
#├─nvme0n1p3 259:3 0 20G 0 part
#│ └─luks-9e2bd0d0-9006-4b4b-b32e-dfd23a3bcceb
#│ 253:0 0 20G 0 crypt /
#├─nvme0n1p1 259:1 0 256M 0 part /boot/efi
#├─nvme0n1p4 259:4 0 217.2G 0 part
#│ └─luks-cf1d74d5-fed2-43bb-b759-06e9a417c30b
#│ 253:1 0 217.2G 0 crypt
#└─nvme0n1p2
# START WITH DEVICE MOUNTED TO /
sudo cryptsetup luksDump /dev/nvme0n1p3
cryptsetup luksAddKey /dev/nvme0n1p3 #add new password
sudo cryptsetup luksDump /dev/nvme0n1p4
#(0 - old pass , 1 - file key, 2 - new pass)
sudo cryptsetup luksKillSlot /dev/nvme0n1p3 0 #remove old pass
sudo cryptsetup luksDump /dev/nvme0n1p4
cryptsetup luksAddKey /dev/nvme0n1p4
sudo cryptsetup luksDump /dev/nvme0n1p4
sudo cryptsetup luksKillSlot /dev/nvme0n1p4 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment