Re: cryptsetup and data-alignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Roscoe wrote:
> On Sat, Jul 18, 2009 at 7:04 PM, Sven
> Eschenberg<sven@xxxxxxxxxxxxxxxxxxxxx> wrote:
>> Sorry for answering my own mail,
>>
>> I had a misconception there. I fired various values for dataalignment at
>> cryptsetup and it always chose a value of n*DA >= 4096 sectors. So
>> obviously 4096 sectors seems to be a lower bound I was not aware of.
>>
> You may be underestimating the space LUKS takes up. The PHDR is 592
> bytes, but the keyslot sizes depend on the number of AFstrips and the
> keysize. If one us using AES-256 with XTS and 4000 strips, then the
> space LUKS takes up will be around 2 megabytes.

Exactly, moreover keyslots are aligned to 4k blocks too.

You can check the real data offset in luksDump (Payload offset).

The --align-payload takes argument in sectors (512 bytes) and the real
data alignment is rounded up to multiply of that.

For example, default alignement is 4k with 128bit key you get:
data offset 1032 sectors

With --align-payload=512 you get data offset 1536 (3 * 512).

Milan

p.s.
BTW For LVM over LUKS I mostly use 4MB (Which always aligns to my underlying SSD drive,
the same applies to underlying RAID and chunk/stripe size)

 - properly align partition (use sectors, not default: fdisk -u, or use parted)

 - align data on LUKS drive (e.g. cryptsetup luksFormat ... --align-payload=8192 to align to 4MB)

 - pvcreate --dataalignment 4M to align PV to 4M offset, all LVs will be
aligned automagically when created (option available in recent lvm2)


---------------------------------------------------------------------
dm-crypt mailing list - http://www.saout.de/misc/dm-crypt/
To unsubscribe, e-mail: dm-crypt-unsubscribe@xxxxxxxx
For additional commands, e-mail: dm-crypt-help@xxxxxxxx


[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux