change the key for LUKS - SSD LVM

asked 2018-01-02 18:07:10 -0500

Cyber Linux gravatar image

updated 2018-01-06 09:28:17 -0500


I cannot change the key for LUKS - SSD LVM on Fedora.

    fdisk -l
Device           Start        End   Sectors   Size Type
/dev/nvme0n1p1    2048     411647    409600   200M EFI System
/dev/nvme0n1p2  411648    2508799   2097152     1G Linux filesystem
/dev/nvme0n1p3 2508800 1000214527 997705728 475.8G Linux LVM


cryptsetup luksChangeKey /dev/nvme0n1p3

the output:

Device /dev/nvme0n1p3 is not a valid LUKS device.

My old machine the command works fine!

Thank you


 ls /dev/mapper
control             luks-188a56cb-34fc-4bd9-b73c-0c165eb25cda
fedora_code-00  luks-3dc0d6b0-0f20-47ac-bebb-82b782ba7e67
fedora_code-01  luks-ca68facb-da5b-45a6-b110-d2cb53a99364


cryptsetup luksAddKey /dev/mapper/luks-188a56cb-34fc-4bd9-b73c-0c165eb25cda
Device /dev/mapper/luks-188a56cb-34fc-4bd9-b73c-0c165eb25cda is not a valid LUKS device.
edit retag flag offensive close merge delete


That command works fine with an actual luks device. Please post the output of ls /dev/mapper

fcomida gravatar imagefcomida ( 2018-01-02 21:27:15 -0500 )edit

I Updated the question with the output-thanks

Cyber Linux gravatar imageCyber Linux ( 2018-01-03 03:01:31 -0500 )edit

You can now see your crypted partitions: /dev/mapper/luks-XXXX. It's recommended adding a new key 1st and then remove the old one.

fcomida gravatar imagefcomida ( 2018-01-03 06:27:24 -0500 )edit

Could you please explain more? how could I change the key now?

thank you

Cyber Linux gravatar imageCyber Linux ( 2018-01-05 10:19:20 -0500 )edit

Apply the command in your original question to your luks partitions i.e. /dev/mapper/luks-XXXX. I'd suggest using luksAddKey instead of luksChangeKey

fcomida gravatar imagefcomida ( 2018-01-05 11:12:35 -0500 )edit