1

If I am shrinking a partition containing a LUKS device+, can I verify that I didn't over-shrink the partition without opening the device and verifying the data at a higher layer in the stack?

Or, in other words, is there a way to verify / check a LUKS container's size, and whether it is intact?

I'm after something like LVM's pvck, which doesn't assume anything about the container's contents.

+ A LUKS device is one where the container (header) starts at sector 0.

Tom Hale
  • 28,728
  • 32
  • 139
  • 229

1 Answers1

0

This is not possible as the LUKS / dm-crypt / cryptsetup FAQ page says:

2.15 Can I resize a dm-crypt or LUKS partition?

Yes, you can, as neither dm-crypt nor LUKS stores partition size.

If no size information is stored, then it's not possible to check if the entirety is accessible.

I've asked what gets resized if no size information is stored here.

Tom Hale
  • 28,728
  • 32
  • 139
  • 229