[dm-crypt] (More) Questions about LUKS / LVM

Milan Broz mbroz at redhat.com
Tue Sep 20 18:12:30 CEST 2011


On 09/20/2011 05:21 PM, Alexander Koch wrote:
> Am 20.09.2011 13:47, schrieb Arno Wagner:
>> With an SSD, things are a bit different. Due to the large
>> internal sector size, the header can be in a sector that
>> also has data that gets rewritten in it. As sectors are
>> always written completely, the header then is at risk whenever
>> that data gets rewritten.
> 
> Did I get that right: by using the TRIM-support available with kernel
> 3.1 I risk loosing my LUKS headers at regular use??

NO. TRIM can be enabled only for data area.

LUKS header is mapped separately from data area. I will never enable
TRIM when manipulating with LUKS metadata area of disk in cryptsetup.
 
(But you cannot say what is going inside of disk itself during keyslot write.)

> No chance to align the payload (data) in such a way that it starts at a
> new sector, which then can be TRIMed without loosing the header?

Not to sector, but to trimmed block size (256/512k usually).
It should be aligned this way. If someone misalign that by mistake,
maybe drive internally need to reallocate some pages but it should never
see TRIM command for this area from kernel.

Milan


More information about the dm-crypt mailing list