|
Page 2 of 4
Checking VMFS Disk Alignment
Beginning with ESX v.3.x and later, VMware aligns new partitions to a 64KB boundary. The 64KB boundary will probably suffice for most, but if you want to be extra cautious, you could opt to align at 1024KB (more on that in a minute).
Although the default 64KB alignment offered in ESX v3.x and later will work for most, if your LUN's stripe size is not aligned at 64KB, then you will have to format your VMFS by hand (instructions provided in the Aligning VMFS using fdisk section below). Also, if your environment began on a pre 3.x installation (even if it has since been upgraded) you will suffer from alignment issues. Older versions of ESX, did not conform with disk alignment specifications, so you should double check any older installations.
So that we don't stray to far from the topic at hand, it's probably best to ask your SAN administrator for the correct offset of a given LUN. As long as the offset you choose is a multiple of the LUN's offset, you'll be fine. Using a staring block of 2048 (2048 = 1024KB or 1MB) should account for the stripe sizes of most configurations but not all. If you want to be sure, you must know your LUNs correct offset. Otherwise, use 2048 which should satisfy most configurations - and at only 1024KB is just a drop in the bucket!
By now I'm sure your eager to see how to check our VMFS for alignment with your LUN or RAID set. To do so, issue the following commands from the service console of your ESX host:
- If you’re not logged in at the ‘root’ user, become root first
$ whoami thirt $ su - root Password: |
- List the partitions
- Fdisk will produce output similar to the following:
Disk /dev/disks/vmhba2:0:0:0: 1999.8 GB, 1999839952896 bytes 255 heads, 63 sectors/track, 243133 cylinders, total 3905937408 sectors Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System /dev/disks/vmhba2:0:0:1 128 18446744073320515964 18446744073515033727+ fb VMFS |
- Take note of the start block for each disk. The output isn't very pretty, but the start block in the above output is the second column (we highlighted it in yellow so that it may be more easily seen.) As we have already said, ESX v3.x and later align at 64K boundaries. In the above output, sector 128 = 64K. For most, this will mean your disk is aligned. However as we have already said, double check with your SAN administrator to get the correct alignment value for the given LUN.
Unfortunately, if you find your VMFS is not aligned, there is little you can do. Depending on how much work is involved, you might consider destroying the data store and recreating it through the Virtual Infrastructure Client on an ESX v3.x host or from the service console using fdisk’s expert mode. If you decide to recreate your VMFS, please be aware you will lose any data that exists on the partition, so as always backup your data first!
|