All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Aligning PVs on SSDs?
@ 2009-07-11 10:23 Roy Sigurd Karlsbakk
  2009-07-11 13:51 ` [linux-lvm] " Mike Snitzer
  0 siblings, 1 reply; 2+ messages in thread
From: Roy Sigurd Karlsbakk @ 2009-07-11 10:23 UTC (permalink / raw)
  To: LVM general discussion and development

Hi

I came across an article on http://thunk.org/tytso/blog/2009/02/20/aligning-filesystems-to-an-ssds-erase-block-size/ 
  about filesystem alignment. This mentions some issues about aligning  
PVs in 128k bounderies. See snipped-out text from the article below.

Are there flags like these or similar in helping admins using SSDs  
more efficiently?

roy

> ...
> So I created a 1 gigabyte /boot partition as /dev/sdb1, and  
> allocated the rest of the SSD for use by LVM as /dev/sdb2. And  
> that’s where I ran into my next problem. LVM likes to allocate 192k  
> for its header information, and 192k is not a multiple of 128k. So  
> if you are creating file systems as logical volumes, and you want  
> those volume to be properly aligned you have to tell LVM that it  
> should reserve slightly more space for its meta-data, so that the  
> physical extents that it allocates for its logical volumes are  
> properly aligned. Unfortunately, the way this is done is slightly  
> baroque:
>
> # pvcreate –metadatasize 250k /dev/sdb2
> Physical volume “/dev/sdb2″ successfully created
>
> Why 250k and not 256k? I can’t tell you — sometimes the LVM tools  
> aren’t terribly intuitive. However, you can test to make sure that  
> physical extents start at the proper offset by using:
>
> # pvs /dev/sdb2 -o+pe_start
> PV         VG   Fmt  Attr PSize  PFree  1st PE
> /dev/sdb2       lvm2 –   73.52G 73.52G 256.00K
>
> If you use a metadata size of 256k, the first PE will be at 320k  
> instead of 256k. There really ought to be an –pe-align option to  
> pvcreate, which would be far more user-friendly, but, we have to  
> work with the tools that we have. Maybe in the next version of the  
> LVM support tools….
> ...
--
Roy Sigurd Karlsbakk
(+47) 97542685
roy@karlsbakk.net
http://blogg.karlsbakk.net/
--
I all pedagogikk er det essensielt at pensum presenteres  
intelligibelt. Det er et elementært imperativ for alle pedagoger å  
unngå eksessiv anvendelse av idiomer med fremmed opprinnelse. I de  
fleste tilfeller eksisterer adekvate og relevante synonymer på norsk.

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

* [linux-lvm] Re: Aligning PVs on SSDs?
  2009-07-11 10:23 [linux-lvm] Aligning PVs on SSDs? Roy Sigurd Karlsbakk
@ 2009-07-11 13:51 ` Mike Snitzer
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Snitzer @ 2009-07-11 13:51 UTC (permalink / raw)
  To: Roy Sigurd Karlsbakk; +Cc: LVM general discussion and development


Roy,

You want to use: pvcreate --dataalignment 128k /dev/sdXX

This will guarantee that the start of the data area (pe_start) is
aligned on a 128k boundary.

Mike

On Sat, Jul 11 2009 at  6:23am -0400,
Roy Sigurd Karlsbakk <roy@karlsbakk.net> wrote:

> Hi
>
> I came across an article on 
> http://thunk.org/tytso/blog/2009/02/20/aligning-filesystems-to-an-ssds-erase-block-size/ 
>  about filesystem alignment. This mentions some issues about aligning  
> PVs in 128k bounderies. See snipped-out text from the article below.
>
> Are there flags like these or similar in helping admins using SSDs more 
> efficiently?
>
> roy
>
>> ...
>> So I created a 1 gigabyte /boot partition as /dev/sdb1, and allocated 
>> the rest of the SSD for use by LVM as /dev/sdb2. And that’s where I ran 
>> into my next problem. LVM likes to allocate 192k for its header 
>> information, and 192k is not a multiple of 128k. So if you are creating 
>> file systems as logical volumes, and you want those volume to be 
>> properly aligned you have to tell LVM that it should reserve slightly 
>> more space for its meta-data, so that the physical extents that it 
>> allocates for its logical volumes are properly aligned. Unfortunately, 
>> the way this is done is slightly baroque:
>>
>> # pvcreate –metadatasize 250k /dev/sdb2
>> Physical volume “/dev/sdb2″ successfully created
>>
>> Why 250k and not 256k? I can’t tell you — sometimes the LVM tools  
>> aren’t terribly intuitive. However, you can test to make sure that  
>> physical extents start at the proper offset by using:
>>
>> # pvs /dev/sdb2 -o+pe_start
>> PV         VG   Fmt  Attr PSize  PFree  1st PE
>> /dev/sdb2       lvm2 –   73.52G 73.52G 256.00K
>>
>> If you use a metadata size of 256k, the first PE will be at 320k  
>> instead of 256k. There really ought to be an –pe-align option to  
>> pvcreate, which would be far more user-friendly, but, we have to work 
>> with the tools that we have. Maybe in the next version of the LVM 
>> support tools….
>> ...
> --
> Roy Sigurd Karlsbakk
> (+47) 97542685
> roy@karlsbakk.net
> http://blogg.karlsbakk.net/
> --
> I all pedagogikk er det essensielt at pensum presenteres intelligibelt. 
> Det er et elementært imperativ for alle pedagoger å unngå eksessiv 
> anvendelse av idiomer med fremmed opprinnelse. I de fleste tilfeller 
> eksisterer adekvate og relevante synonymer på norsk.
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

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

end of thread, other threads:[~2009-07-11 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-11 10:23 [linux-lvm] Aligning PVs on SSDs? Roy Sigurd Karlsbakk
2009-07-11 13:51 ` [linux-lvm] " Mike Snitzer

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.