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

I believe I suffer from "everything must be in powers of 2" syndrome. When asked to create a 30G disk in VmWare for a VM I want to create a 32G disk. If someone needs 256G of storage using LVM I create 1 256, 2 128s, or 4 64s...

The question is straightforward, are there performance impacts or drawbacks to creating "odd" sized disks, even when I put them into a Volume Group on Linux? If someone asks for 80G is it okay to create a 10, a 20, and a 50 to accomplish it? or should I try to stick to powers of 2 if I can?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

I would rather recommend you to keep an eye on the fact whether a partition is so-called I/O aligned as this may really affect I/O performance. Nowadays, it's not such issue as installers or configuration wizards usually align partitions automatically on some "power of 2" boundary but when you create it by hand it may be still useful to know how it works.

I will try to explain the concept on simple example borrowed from virtual environments. For the sake of simplicity, let's assume VMware vSphere infrastrucuture and VMFS filesystem. We have to take into account three layers in total - a disk array which has chunks of some size for requesting data, VMFS filesystem with blocks of some size and finally a guest operating system filesystem organized in blocks/clusters.

Usually, you don't have to spend time on aligning VMFS filesystem with disk array as it is performed automatically when you create a new VMFS datastore with vCenter. The situation is worse with guest OS. Below is a picture of unaligned layers:

enter image description here

When the guest OS reads/writes a single block/cluster the underlaying hypervizor/disk array will have to request one block from VMFS filesystem and two disk array chunks as the block spans multiple chunks. This may mean to read or write from multiple disk spindles as these chunks may be striped over multiple disks depending on RAID configuration. This is not optimal configuration of course. Better is the aligned one:

enter image description here

Then, one filesystem block request generates one disk array chunk request. Nevertheless, the most of the modern operating systems remember to I/O align partitions automatically during their installation. For example, Windows Server 2008 or RedHat Enterprise Linux 6 do it but Windows Server 2003 or older distros don't.

So it is still worth to remember it as automatic I/O alignment usually depends on storage devices features to indicate their preffered I/O alignment and I/O block size. The modern Linux I/O stacks (e.g. RHEL 6, parted, LVM, mkfs) can work with such information and so perform it automatically. But if it's not working as expected you should do it by hand.

share|improve this answer
add comment

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.