Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

According to http://www.yellow-bricks.com/2010/04/08/aligning-your-vms-virtual-harddisks/ it is important to align the virtual hard drives of virtual machines for performance. I'm running virtual machines in an environment built on Debian, KVM and LVM.

What steps should be taken to get alignment right when installing a host node?

How can the alignment be checked on an already installed node?

Can the alignment be altered without re-installation? How?

share|improve this question
    
Interesting. I'm going through the article but have yet to see what they mean by aligning the drives. Anyone shed light on this? (as in how do they get out of alignment in the first place) –  Bart Silverstrim Jul 19 '10 at 12:33
    
One of the comments is saying that NT up to 7/vista(?) were just misaligned by default. Anyone know if there was a technical reason for it? Has this long been a performance issue variable and I just haven't run across it before? I'm feeling rather dim at the moment for not having heard of it before. –  Bart Silverstrim Jul 19 '10 at 12:38
    
Also, is this an issue for all VM systems, or only those on a particular filesystem(s) or combination of filesystem(s) between guests and hosts? –  Bart Silverstrim Jul 19 '10 at 12:43
    
@Bart, starting with Vista/2008 the partitions are aligned on 1MB by default (a common multiple of every popular block size). Before that they were commonly aligned on 31.5KB. This is an "issue" for all systems which use disks more complex than a single simple HD (with 512-byte sectors only; 31.5KB is a multiple of 512B, but isn't for just about anything else). Most newer platforms auto-align, but older ones do not hence this becoming an issue in virtualization environments where older OSes are increasingly run. –  Chris S Sep 13 '10 at 13:12

3 Answers 3

up vote 1 down vote accepted

You need to know the block size of your disk, or the stripe size on a raid/LVM. Misaligned partitions happen in cases where the blocks of the filesystem are not 'aligned' with the blocks on the disk (or chunks in a striped environment like storages, RAID or LVM). So, if you have a 8k chunk size on the storage, use 8k block sizes on the host filesystem. Also, the first partition on the disk will lose 63 kb because of the MBR, start your partition (using fdisk) on the next chunk/block boundary. Example: you have a 64k chunk on your RAID/Storage array, so start the partition on the 128th kb so you will be aligned to the 2nd chunk in your array. Good info here: http://www.vmware.com/pdf/esx3_partition_align.pdf

EDIT: To check the current alignment do a fdisk -l on the disk you are using:

# fdisk -lu /dev/sda
Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    97659134    48829536    7  HPFS/NTFS

As you can see, it is starting at 63 (right after the MBR) so its probably unaligned to the disk block size. Most people recommend you to use 128 but this value can change depending on the disk cluster size.

Unfortunately, you have to re-partition your drive to fix that, but maybe using some tool like parted you may be able to change it 'on the fly' or at least without the format.

share|improve this answer
    
Gparted 'on the fly' usually takes hours :-) –  Antoine Benkemoun Sep 13 '10 at 10:00

see the following for a full description of the issues involved

http://msdn.microsoft.com/en-us/library/dd758814(SQL.100).aspx

share|improve this answer

Found a relevant blog post

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.