[[How To]] | [[LUKS]]
# How to add a new passphrase to LUKS
[How to change LUKS disk encryption passphrase in Linux](https://itsfoss.gitlab.io/post/how-to-change-luks-disk-encryption-passphrase-in-linux/)
Identify the LUKS partition:
```sh
lsblk
```
Should give you something like:
```txt
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 465.8G 0 disk
├─nvme0n1p1 259:1 0 1G 0 part /boot
├─nvme0n1p2 259:2 0 422.1G 0 part
│ └─luks-lfdh6awk-hx9p-plbt-nfvv-rzksdjdpy9sa 254:0 0 422.1G 0 crypt /nix/store
│ /
└─nvme0n1p3 259:3 0 42.6G 0 part
└─luks-2a10928f-42g2-52gd-b7a0-42ci6cd84f17 254:1 0 42.6G 0 crypt [SWAP]
```
Grab the appropriate device, e.g.:
```sh
/dev/nvme0n1p2
```
Verify it's LUKS:
```sh
sudo cryptsetup luksDump /dev/nvme0n1p2
```
Add new passphrase:
```sh
sudo cryptsetup luksAddKey /dev/nvme0n1p2
```
Make sure to run this for every partition, e.g. don't forget to run it on the main nix partition AND the swap partition, or you'll run into one unlocking but not the other.
If the LUKS drive isn't already unlocked (e.g. mounting an external drive with a LUKS partition), you will need to unlock the partition before making edits:
```sh
sudo cryptsetup luksOpen /dev/nvme0n1p2 some_temp_name_here
```