Operating System - Linux
1753351 Members
5186 Online
108792 Solutions
New Discussion юеВ

Re: Do I need to do any disk alignment when not using partitions

 
SOLVED
Go to solution
Timothy Czarnik
Esteemed Contributor

Do I need to do any disk alignment when not using partitions

Assuming that we don't partition disks before presenting them to LVM for use (essentially just using pvcreate on them and then vgcreating or vgextending onto them) is there any additional disk "aligning" I should be doing?

Assumptions:
SuSE 11
EMC VMAX disk with proper director flags set
PowerPath

It is my understanding that the requirement for partition alignment is from leftover legacy BIOS parameters. If we're not using fdisk or partitions on the disks is there still a need to do any disk alignment? Does the pvcreate process and LVM remove the need for this?

If there is I guess my next question would be what steps should be taken to perform this alignment? I see plenty of information on the web about aligning partitions but I haven't found anything about disk alignment when not using partitions and using whole disks.

Thanks in advance!

Tim

Hey! Who turned out the lights!
2 REPLIES 2
Matti_Kurkela
Honored Contributor
Solution

Re: Do I need to do any disk alignment when not using partitions

If your storage requires alignment to 64k or less, LVM provides it to you by default: the first physical extent will be placed at 192 kiB (= 3*64) from the beginning of the PV. But if you need to align to multiples of 128 or larger, you'll need to add an option to pvcreate.

(This information is included in at least two or three latest releases of EMC Connectivity Guide for Linux.)

To view the alignment used by LVM, run "pvs -o +pe_start". The "1st PE" column will specify the location of the first physical extent relative to the beginning of the PE, and thus your alignment.

Newer versions of the LVM tools include the --dataalignment option for pvcreate, which allows you to solve this easily.

For example:
pvcreate --dataalignment 256k /dev/sdXX

If the pvcreate command of your distribution does not have the --dataalignment option, you can achieve the same effect using the --metadatasize option, but you may need a bit of trial and error: for example, to get the first extent to 256k alignment, you should use "--metadatasize 192k".

MK
MK
Timothy Czarnik
Esteemed Contributor

Re: Do I need to do any disk alignment when not using partitions

Matti,

Your answer is a perfect example of why these forums are so awesome.

Thanks!

Tim
Hey! Who turned out the lights!