All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] status of dm-crypt (alignment issues) on a SSD
@ 2010-12-01 14:51 mike dentifrice
  2010-12-02  7:54 ` Luca Berra
  0 siblings, 1 reply; 5+ messages in thread
From: mike dentifrice @ 2010-12-01 14:51 UTC (permalink / raw)
  To: dm-crypt

Hello,

I'm about to install a laptop (using Debian Squeeze) that ships a SSD
instead of a HDD for the first time (using GPT partitionning, then
dm-crypt over a partition, then LVM2 to make a physical volume out of
the crypto device, and logical volumes underneath).

I've done some searching/reading on the alignment issues involving SSD,
and most threads end up stating that things will eventually work "out of
the box" at some point. Most of them are quite old though, so I'd like
to know what the status on this alignment issue is, and, if possible,
what software versions are required for things to work properly (I
understood that linux >= 2.6.33 was a good starting point, but what
about cryptsetup, lvm2, util-linux, etc.?).

Here are the software versions I'm likely to find within the latest
debian-installer snapshot:

  - linux-image-2.6.32-5-amd64 2.6.32-28
  - util-linux 2.17.2-3.3
  - dmsetup 2:1.02.48-4
  - lvm2 2.02.66-4
  - cryptsetup 2:1.1.3-4

Any hint would be greatly appreciated (including pointers to up-to-date
HOWTOs which I may have missed). Also, if you guys know which specific
feature of linux 2.6.33 is required, it would allow me to check whether
it's been backported to Debian's 2.6.32 or not.

Thanks a lot,

-- 
mike dentifrice <fluor@poivron.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] status of dm-crypt (alignment issues) on a SSD
  2010-12-01 14:51 [dm-crypt] status of dm-crypt (alignment issues) on a SSD mike dentifrice
@ 2010-12-02  7:54 ` Luca Berra
  2010-12-02 11:44   ` Milan Broz
  2010-12-02 11:50   ` mike dentifrice
  0 siblings, 2 replies; 5+ messages in thread
From: Luca Berra @ 2010-12-02  7:54 UTC (permalink / raw)
  To: dm-crypt

On Wed, Dec 01, 2010 at 03:51:24PM +0100, mike dentifrice wrote:
>Any hint would be greatly appreciated (including pointers to up-to-date
>HOWTOs which I may have missed). Also, if you guys know which specific
>feature of linux 2.6.33 is required, it would allow me to check whether
>it's been backported to Debian's 2.6.32 or not.
i dont know about debian and which software version has which feature,
but:

what you need on kernel side is having in sysfs
under /sys/block/<device>
queue/minimum_io_size
queue/optimal_io_size
queue/physical_block_size

on tool side,
for util-linux
ldd /sbin/fdisk | grep blkid
strings /lib/libblkid.so.1 | grep queue/

for lvm
strings /sbin/lvm |grep queue/

and so on.

-- 
Luca Berra -- bluca@comedia.it

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] status of dm-crypt (alignment issues) on a SSD
  2010-12-02  7:54 ` Luca Berra
@ 2010-12-02 11:44   ` Milan Broz
  2010-12-02 11:50   ` mike dentifrice
  1 sibling, 0 replies; 5+ messages in thread
From: Milan Broz @ 2010-12-02 11:44 UTC (permalink / raw)
  To: dm-crypt

On 12/02/2010 08:54 AM, Luca Berra wrote:

> what you need on kernel side is having in sysfs
> under /sys/block/<device>
> queue/minimum_io_size
> queue/optimal_io_size
> queue/physical_block_size

Just not all SSD presents proper values here.

My advice is align to 1MiB in such case and it will work:-)
(this is default in recent versions - not all yet in Debian)

You can always do it manually, use fdisk -u (to work in sector mode,
note sector is 512B. Switch off DOS mode if it is enabled - there
should be warning)

For lvm, use pvcreate --dataalignment, then check with pvs -o +pe_start.
(You can use --units S to work in sectors mode like in fdisk.
2048 sectors == 1MiB, any multiple of it is ok)

(See man page and check archive, I think it was described here
several times.)

Milan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] status of dm-crypt (alignment issues) on a SSD
  2010-12-02  7:54 ` Luca Berra
  2010-12-02 11:44   ` Milan Broz
@ 2010-12-02 11:50   ` mike dentifrice
  2010-12-02 12:08     ` Milan Broz
  1 sibling, 1 reply; 5+ messages in thread
From: mike dentifrice @ 2010-12-02 11:50 UTC (permalink / raw)
  To: dm-crypt

Thanks a lot for your reply!

Luca Berra a dit:
> what you need on kernel side is having in sysfs
> under /sys/block/<device>
> queue/minimum_io_size
> queue/optimal_io_size
> queue/physical_block_size

These are present while running Debian's 2.6.32-5 linux kernel.

> on tool side,
> for util-linux
> ldd /sbin/fdisk | grep blkid

$ ldd /sbin/fdisk | grep blkid
        libblkid.so.1 => /lib/libblkid.so.1 (0x00007fd182e63000)

> strings /lib/libblkid.so.1 | grep queue/

$ strings /lib/libblkid.so.1 | grep queue/
	queue/minimum_io_size
	queue/optimal_io_size
	queue/physical_block_size

> for lvm
> strings /sbin/lvm |grep queue/

$ strings /sbin/lvm | grep queue/
	queue/optimal_io_size
	queue/minimum_io_size

> and so on.

So far, everything seems good as far as I understnad, but should
`cryptsetup` have 'queue' strings as well ? Mine (v1.1.3) doesn't. I
compiled 1.2.0-rc1 and it doesn't either. Is that a stopper of not?

Thanks,

-- 
mike dentifrice <fluor@poivron.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] status of dm-crypt (alignment issues) on a SSD
  2010-12-02 11:50   ` mike dentifrice
@ 2010-12-02 12:08     ` Milan Broz
  0 siblings, 0 replies; 5+ messages in thread
From: Milan Broz @ 2010-12-02 12:08 UTC (permalink / raw)
  To: mike dentifrice; +Cc: dm-crypt

On 12/02/2010 12:50 PM, mike dentifrice wrote:
> So far, everything seems good as far as I understnad, but should
> `cryptsetup` have 'queue' strings as well ? Mine (v1.1.3) doesn't. I
> compiled 1.2.0-rc1 and it doesn't either. Is that a stopper of not?

Grepping for queue is not clever idea, sorry.

1.1.3 has topology support, 1.2.0 adds 1MiB default here.

Run luksFormat --debug and you will see topology info read from kernel:

# Topology: IO (512/0), offset = 0; Required alignment is 4096 bytes.

512/0, offset = 0 means min io size / opt io size and offset from sysfs.

For ssd it should be surenly not 512 but something like write block.

Milan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-12-02 12:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-01 14:51 [dm-crypt] status of dm-crypt (alignment issues) on a SSD mike dentifrice
2010-12-02  7:54 ` Luca Berra
2010-12-02 11:44   ` Milan Broz
2010-12-02 11:50   ` mike dentifrice
2010-12-02 12:08     ` Milan Broz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.