2

I want to re-encrypt a system and swap partitions on EndeavourOS. The issue is that in many files (crypttab, mikinicpio, fstab, etc) the exact UUID of the LUKS partition is built in, meaning I would have to change manually the UUID after re-encryption if it this the case for the system and bootloader to recognize the partitions as parts of the system.

Does the UUID change after re-encryption? If not, then I can simply re-encrypt (with a backup of course) and be done with it.

1
  • 1
    Are you talking about the UUID of the filesystem within the LUKS partition or some other UUID of the partition itself?
    – muru
    Aug 3 at 8:44

1 Answer 1

3

Looks like it does not:

# lsblk -f /dev/sde2
NAME FSTYPE      FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sde2 crypto_LUKS 2           d37a4c03-8ca2-4410-97d8-77bb39d4b499                

# cryptsetup reencrypt /dev/sde2
Enter passphrase for key slot 0: 
Finished, time 00m01s,   84 MiB written, speed  72.9 MiB/s

# lsblk -f /dev/sde2
NAME FSTYPE      FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sde2 crypto_LUKS 2           d37a4c03-8ca2-4410-97d8-77bb39d4b499   

It makes sense that the UUID doesn't change -- it's a unique identifier of the format and it is created when the format is created, reencrypt doesn't recreate the LUKS format, it just changes some parameters.

1
  • Okay, that sounds good. I assume that this means that the bootloader (GRUB in this case) and the kernel would recognize it after the cipher and hash have changed (what I intend to change for re-encryption.)
    – user549014
    Aug 7 at 23:32

You must log in to answer this question.