[dm-crypt] cryptsetup alignment

Christoph Anton Mitterer calestyo at scientia.net
Sat Jun 29 05:21:19 CEST 2013

Hi Milan, et al.

Can I find out why cryptsetup created my LUKS devices with a payload
offset of 4096?
I mean these are 512B sectors right?... I though all tools would
nowadays align to 1 MiB  but that would be 2048 S.

The only possible reason I could see would be the following:
physical disc   ->
MBR partition /dev/sda1 at 2048S   ->
LVM PV on /dev/sda1 with alignment to 2048S    ->
LUKS on an LV on that PV with 4096S

So the data of the LV starts at 4096S which is 2 MiB.
The extent size of the VG is 4 MiB.

So when LUKS uses another 4096S (aka 2MiM).. then the (e.g.) filesystem
on top of LUKS will not only be aligned to the blocks of the disk (even
to any potential 4K disk blocks)... but also to the physical extents of
the LVM...

Is it _really_ that smart that it auto detected this and also included
the LVM's PE size into it's calculations?

If so please warn me to take a seat before I read your "yes"... ;-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5165 bytes
Desc: not available
URL: <http://www.saout.de/pipermail/dm-crypt/attachments/20130629/9c686275/attachment.bin>

More information about the dm-crypt mailing list