ESXi

 View Only
  • 1.  disk alignment and LVM volumes

    Posted Jan 15, 2010 06:22 PM

    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



  • 2.  RE: disk alignment and LVM volumes
    Best Answer

    Posted Feb 08, 2010 11:19 PM

    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!!



  • 3.  RE: disk alignment and LVM volumes

    Posted Feb 09, 2010 07:55 AM

    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.



  • 4.  RE: disk alignment and LVM volumes

    Posted Feb 09, 2010 02:46 PM

    Hi,

    remember to award any answer you consider helpful :smileywink:

    Thanks

    Un saludo/Regards,

    Pablo

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



  • 5.  RE: disk alignment and LVM volumes

    Posted Feb 09, 2010 03:11 AM

    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.



  • 6.  RE: disk alignment and LVM volumes

    Posted Feb 09, 2010 07:51 AM

    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?



  • 7.  RE: disk alignment and LVM volumes

    Posted Feb 09, 2010 08:04 AM

    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!!



  • 8.  RE: disk alignment and LVM volumes

    Posted Feb 09, 2010 04:02 PM

    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 :smileyhappy: Thanks for the answers so far!



  • 9.  RE: disk alignment and LVM volumes

    Posted Feb 09, 2010 02:55 PM

    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.



  • 10.  RE: disk alignment and LVM volumes

    Posted Feb 09, 2010 04:07 PM

    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 :smileyhappy: