VMware Cloud Community
dnetz
Hot Shot
Hot Shot
Jump to solution

disk alignment and LVM volumes

Hi,

I'm trying to create a CentOS installation that will have its disks aligned according to best practices by Netapp (TR-3747) and I can't work out how to do this for LVM volumes as well. Aligning the boot partition and regular ext3 partitions seems easy using fdisk before starting the install, but the partitioning during the install insists on creating the LVM volume from unused space on the drive instead of the aligned second partition. Now I know that the Netapp tools for aligning already existing disks (mbralign) does not support LVM, does this mean that LVM itself won't allow itself to be aligned this way?

I should add that my knowledge about linux, and especially LVM is limited.

Thanks in advance,

Daniel

Reply
0 Kudos
1 Solution

Accepted Solutions
Borja_Mari
Virtuoso
Virtuoso
Jump to solution

Hi,

aligning partitions to follow the storage & vmware best practiques sometimes is tricky. For example if the alignment is done before the operating system install.

Usually LVM is used for partitions that can grow quickly in time and maybe is not easy to calculate the definitive size at the beginning. In other words, dynamic data partitions, not system partitions.

Edit (Thanks BigHug):

Normally i don't use LVM partitions, but if you have problems to get working LVM+alignment during the CentOS install, you should be able to configure LVM after install, when the partitions from the disk are all aligned.

Later, when the CentOS is up and running is easy convert the data partition (that it should be empty) to a LVM partition.

Simply copy using (for example) find & cpio or cp the data (if any) from the data partition to a temporal directory in another partition, umount it, convert to LVM (using typical lvm commands), format and mount it and finally reverse the data copy.

Hope it helps.

Un saludo/Regards,

Pablo

Please consider awarding any helpful answer. Thanks!! - Por favor considera premiar las respuestas útiles. Muchas gracias!!

------------------------------------------------------------------------------------------------- PLEASE CONSIDER AWARDING any HELPFUL or CORRECT reply. Thanks!! Por favor CONSIDERA PREMIAR cualquier respuesta ÚTIL o CORRECTA . ¡¡Muchas gracias!! VCP3, VCP4, VCP5-DCV (VCP550), vExpert 2010, 2014 BLOG: http://communities.vmware.com/blogs/VirtuallyAnITNoob

View solution in original post

Reply
0 Kudos
9 Replies
Borja_Mari
Virtuoso
Virtuoso
Jump to solution

Hi,

aligning partitions to follow the storage & vmware best practiques sometimes is tricky. For example if the alignment is done before the operating system install.

Usually LVM is used for partitions that can grow quickly in time and maybe is not easy to calculate the definitive size at the beginning. In other words, dynamic data partitions, not system partitions.

Edit (Thanks BigHug):

Normally i don't use LVM partitions, but if you have problems to get working LVM+alignment during the CentOS install, you should be able to configure LVM after install, when the partitions from the disk are all aligned.

Later, when the CentOS is up and running is easy convert the data partition (that it should be empty) to a LVM partition.

Simply copy using (for example) find & cpio or cp the data (if any) from the data partition to a temporal directory in another partition, umount it, convert to LVM (using typical lvm commands), format and mount it and finally reverse the data copy.

Hope it helps.

Un saludo/Regards,

Pablo

Please consider awarding any helpful answer. Thanks!! - Por favor considera premiar las respuestas útiles. Muchas gracias!!

------------------------------------------------------------------------------------------------- PLEASE CONSIDER AWARDING any HELPFUL or CORRECT reply. Thanks!! Por favor CONSIDERA PREMIAR cualquier respuesta ÚTIL o CORRECTA . ¡¡Muchas gracias!! VCP3, VCP4, VCP5-DCV (VCP550), vExpert 2010, 2014 BLOG: http://communities.vmware.com/blogs/VirtuallyAnITNoob
Reply
0 Kudos
BigHug
Enthusiast
Enthusiast
Jump to solution

Daniel:

On your root disk (vmdk), the first partition is /boot, the second one is swap (if swap is not in the lvm) and third one is lvm. Once you aligned the disk, all 3 partitions will be aligned, since they are on the same disk just different partition. Am I missing something? Or you have muliple disks for OS.

BTW, mbralign works on lvm too. It will be much easier just build the server and use mgralign to align the server.

Hope this helps.

Reply
0 Kudos
dnetz
Hot Shot
Hot Shot
Jump to solution

Isn't it the partitions themselves that are aligned and not the entire disk? We only have one disk for OS and the problem is that CentOS doesn't seem to want to create lvm volumes on existing aligned partitions, just free disk space which if I'm not mistaken about the first part of this post, won't be aligned.

The mbralign 1.4 faq (http://communities.netapp.com/docs/DOC-2932) states that LVM is not supported, is this not the case anymore?

Reply
0 Kudos
dnetz
Hot Shot
Hot Shot
Jump to solution

Thanks for the answer, I talked to the guys responsible for linux installs about this and in their opinion LVM is more work than it's worth for just managing OS partitions. Since we'll mount most other data by NFS then we should be fine with using regular partitions. Still, this whole disk alignment business is quite confusing and I'd love to see some kind of assistance from Vmware in the matter or better knowledge on virtualization needs from the OS manufacturers.

Reply
0 Kudos
Borja_Mari
Virtuoso
Virtuoso
Jump to solution

Hi,

when you align the first partition, the next partitions you will create later (second, third, etc) from the whole disk are aligned too.

Are you sure that is no possible to convert a aligned partition to LVM using the typical lvm commands? (pvcreate, vgcreate, etc).

AFAIK, the lvm commands don't take care from the partitions alignment.

Un saludo/Regards,

Pablo

Please consider awarding any helpful answer. Thanks!! - Por favor considera premiar las respuestas útiles. Muchas gracias!!

------------------------------------------------------------------------------------------------- PLEASE CONSIDER AWARDING any HELPFUL or CORRECT reply. Thanks!! Por favor CONSIDERA PREMIAR cualquier respuesta ÚTIL o CORRECTA . ¡¡Muchas gracias!! VCP3, VCP4, VCP5-DCV (VCP550), vExpert 2010, 2014 BLOG: http://communities.vmware.com/blogs/VirtuallyAnITNoob
Reply
0 Kudos
Borja_Mari
Virtuoso
Virtuoso
Jump to solution

Hi,

remember to award any answer you consider helpful Smiley Wink

Thanks

Un saludo/Regards,

Pablo

Please consider awarding any helpful answer. Thanks!! - Por favor considera premiar las respuestas útiles. Muchas gracias!!

------------------------------------------------------------------------------------------------- PLEASE CONSIDER AWARDING any HELPFUL or CORRECT reply. Thanks!! Por favor CONSIDERA PREMIAR cualquier respuesta ÚTIL o CORRECTA . ¡¡Muchas gracias!! VCP3, VCP4, VCP5-DCV (VCP550), vExpert 2010, 2014 BLOG: http://communities.vmware.com/blogs/VirtuallyAnITNoob
Reply
0 Kudos
BigHug
Enthusiast
Enthusiast
Jump to solution

Misalignment is due to the mbr on the disk. One disk only has a mbr. Once you align the first partiton, the rest of partitions will be aligned too. Unless you manually change the starting offset on the non-first partitions.

As for the lvm, thanks for pointing out the faq. It's probably the metadata of lvm will have a problem after aligned by mbralign. Make senses. Anyway, we have aligned several lvm disks and didn't experienced any problem yet. I guess the problem is probably at the end of pv. Once we don't fill up the pv. We are ok.

However, since he author says don't use it on lvm, don't use it then. I take back my suggestion in my previous post. Sorry to post a bad suggestion.

dnetz
Hot Shot
Hot Shot
Jump to solution

Hi,

when you align the first partition, the next partitions you will create later (second, third, etc) from the whole disk are aligned too.

Netapp's tool mbrscan doesn't seem to think so, but then again it might only be dividing the partition offset by 4,096 and nothing else.

Are you sure that is no possible to convert a aligned partition to LVM using the typical lvm commands? (pvcreate, vgcreate, etc).

AFAIK, the lvm commands don't take care from the partitions alignment.

It might be, I've just been using the CentOS 5 graphical installationas reference and it doesn't seem to allow LVM volumes on anything but free space.

Un saludo/Regards,

Pablo

Please consider awarding any helpful answer. Thanks!! - Por favor considera premiar las respuestas útiles. Muchas gracias!!

Don't worry, I will Smiley Happy Thanks for the answers so far!

Reply
0 Kudos
dnetz
Hot Shot
Hot Shot
Jump to solution

Thanks, it's starting to make a little more sense to me now. Netapp is probably being cautious about LVM volumes so they're not liable for any damage that might occur during mbralign. Also, I didn't mean to imply that your suggestion was bad, not at all. This concept is just a little hard to grasp unless you're an experienced linux admin which I'm not Smiley Happy

Reply
0 Kudos