[virt-tools-list] block alignment

Richard W.M. Jones rjones at redhat.com
Wed Apr 20 17:15:28 UTC 2011

On Wed, Apr 20, 2011 at 10:41:20AM -0400, Gary Scarborough wrote:
> I was wondering if KVM on fedora suffered from the same type of
> block alignment problems that VMware has?  Do users need to be
> concerned about block alignment with KVM?

It's supposed to all be fixed in recent kernels (where recent ~~ RHEL 6
era, so say Fedora 12 onwards).  Hard drives themselves export
information about desired alignment, and this is supposed to go up
through all the layers, even into virtual machines.  You can test what
alignment information is available through all the layers using the
blockdev command.  Interesting blockdev options that have been added
recently include:

              Get alignment offset.
              Get discard zeroes support status.
              Get minimum I/O size.
              Get optimal I/O size.
              Get physical block (sector) size.

However .. it depends on various factors which can be outside our
control.  Notably:

Hard drives can just have wrong information.  They can also do stupid
stuff like lying about alignment (particularly the case with new 4K

SANs might not supply the right info.

Some guests (notably Windows XP) don't align partitions correctly
unless you take some complex extra steps.  Shouldn't be a problem with
recent guests.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.

More information about the virt-tools-list mailing list