You are not logged in.

#1 2014-01-18 03:29:44

gardar
Member
From: Reykjavik, Iceland
Registered: 2012-03-23
Posts: 8

Advanced format (4k sector disks) and cryptsetup

Did a quick search but came up empty handed.

I'm wondering if there is anything special that needs to be passed to be able to use dm-crypt (cryptsetup) with 4096 byte sector drives.

I know md, lvm, partitions, filesystems all need to have special triggers for 4K drives (even thouh I think it's done automatically for all of them nowadays) but I see no mention of cryptsetup.

Offline

#2 2014-01-19 18:04:29

gardar
Member
From: Reykjavik, Iceland
Registered: 2012-03-23
Posts: 8

Re: Advanced format (4k sector disks) and cryptsetup

Asked this question in the dm-crypt mailinglist and this is the reply I got

Do not worry. Dm-crypt uses 512B sectors, but there is only a
negligible performance loss. This matters far, far more on the
filesystem layer. If that layer does it right, dm-crypt will
allways process 8 x 512B at a time, as it does process exacly
what the uppeer layer requests. And alignment in LUKS is done
so that 4k sectors will not be broken up for the data area.

and this has been added to their FAQ section 2.17 http://code.google.com/p/cryptsetup/wik … s#2._Setup

Offline

#3 2014-01-19 21:29:19

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: Advanced format (4k sector disks) and cryptsetup

You don't have to do anything special if your cryptsetup version is recent enough.

cryptsetup luksDump should print Payload offset 4096, that makes the data MiB aligned. Older versions of cryptsetup used to align differently (2056 or something which is 1MiB + 4k, which may not be optimal for SSD).

Of course, everything else (partitions, md, lvm, filesystems, etc.) has to be aligned as well; recent versions of mdadm also go for MiB alignment, so in a current install, you should not have to worry as long as you do not mess up the partitioning.

Last edited by frostschutz (2014-01-19 21:29:53)

Offline

#4 2014-01-19 21:33:33

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Advanced format (4k sector disks) and cryptsetup

As far as I know, I think LVM is the only one where you still have to ensure proper alignment manually.  Though it has been several months since I have used it, so maybe this has changed as well.

Offline

#5 2014-01-19 22:35:11

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: Advanced format (4k sector disks) and cryptsetup

LVM: pvs -o +pe_start,vg_extent_size should show 1.00MiB (or multiple thereof) for 1st PE, and 4.00MiB (or multiple of 1MiB, usually something in the 4-128MiB range) for Ext.

Offline

Board footer

Powered by FluxBB