[dm-crypt] aes-xts-plain with aes_x86_64 makes my SSD 5x slower than my encrypted HD

Heinz Diehl htd at fancy-poultry.org
Tue Jul 24 08:11:48 CEST 2012

On 24.07.2012, Milan Broz wrote: 

> Disk driver should set topology parameters which fdisk uses. But for your
> case all is set to 512 bytes...

In case of a 4k alignment, I use "fdisk -c -u /dev/sda". The first
partition will start at 2048, and all gets properly aligned as long 
as I'm using "+G" for defining the partitions. The last partition 
on a disk can be misaligned if you choose to use "the rest". Since 
fdisk displays the sectors in an inclusive way, the endsize fdisk is
showing ("p") +1 should be divisible by 8. You can see it the other 
way round and say (endsize MOD 8 = 7). 

It's the same thing with Western Digital and Seagate drives which
use "advanced format". As far as I know, proper alignment is not the
whole thing: some drives doesn't report that they are using the 
new blocksize, and the OS can therefore not know (reporting 512/512
logical/physical blocksize, instead of 512/4096). So the filesystem 
which is created on top of these partitions has to be created using 
the 4096 blocksize: "mkfs.ext4 -b 4096 /dev/sdx", e.g.

I don't know how this is handled via the dmcrypt layer..

More information about the dm-crypt mailing list