You are here

The partition is misaligned by 48128 bytes - warning from Linux RAID

Submitted by Peter on Tue, 2011-05-03 16:23

Technology:

Warning: The partition is misaligned by 48128 bytes. This may result in very poor performance. Repartitioning is recommended.
Warning: The partition is misaligned by 2048 bytes. This may result in very poor performance. Repartitioning is recommended.
These are warnings from Linux RAID. Help!

The problem occurs on an Ubuntu 11.4 computer created with several disks in a RAID 5 array. The disks are all the same model.

I looked through the Ubuntu forums. Several Ubuntu experts say this is a problem caused by creating RAID arrays using odd software. Dont, they say, use mdadm! I used mdadm and receive exactly the same error message as everyone else.

Some of the responses say you should not change anything unless you can measure a performance problem. Measuring the performance is impossible until you have an identical system without the error message. You have to measure the performance then fix the problem causing the error then measure the performance again. So we are back at the question of how do we remove the error message?

MBR or GUID?

All disks start with an initial entry that is usually an MBR, Master Boot Record. Disks larger than 2 TeraBytes have to use a GUID instead of an MBR. If you use OSX, you probably use an Apple Partition Map which may or may not work with modern disks.

My disks are within the 2 TB limit for an MBR and were initially formatted with MBRs. Linux complained that it could not create the RAID array because the array is larger than 2 TB and needs GUID. I changed all the disks to use GUID and then the partition misalignment error occurred. I removed some disks to bring the array back under 2 TB and recreated everything using MBR. The partition misalignment error occurred again.

Advanced Format Disk

You will hear a lot about ADF, Advanced Format Disk. Disk manufacturers are finally switching from obsolete 512 byte sectors to 4096 byte sectors. The history is in Disk block size. ADF is their fancy name for the new disks. The thing is, it is not the advanced format. Instead it is a painfully retrograde step where they internally use 4096 sectors but then emulate 512 byte sectors, a process that ruins performance. You will not be allowed to buy real 4096 sector disks for at least another year.

What will they call the real 4096 byte sector disks? AFRANMBD, Advanced Format, Really Advanced, No Marketing Bull Dust.

You get bad performance from AFD. You get worse performance if your disk IO is not aligned with the internal format that the disks hide. Your operating system and file system has to guess what is really happening within the disk then try to adjust partition layout to match the physical sectors it is not allowed to see because of some idiots on a committee.

Old disks

Fortunately my disks are old enough to not be ADF, not the disks marked ADF or the one of the disks that is ADF but is not marked ADF. Their performance is not reduced by the pathetic emulation or a misalignment problem. I am back to removing an error message that is not applicable but is still annoying.

Linux?

I am using a current version of Linux everywhere and the current version is supposed to automatically align disks in a way that solves the problems caused by ADF. no, linux is not yet working.

Ubuntu?

Ubuntu 11.4 includes the latest Linux. Ubuntu should not cause the error, assuming Ubuntu uses up to date utilities with the latest Linux.

You can create RAID arrays during the installation of Ubuntu if you use the alternate edition instead of the desktop edition. The alternate edition installs mdadm to to manage the array after the installation.

If you install ubuntu using the alternate edition but do not create the array during installation, Ubuntu does not install mdadm and you have to manually install mdadm using the Ubuntu Software Centre.

Ubuntu 11.4 creates RAID arrays in System, Administration, Disk utility. Disk utility is just the usual Linux graphical front end for a utility, mdadm in this case. As usual with graphical interfaces trying to secretly run a utility in the background, Disk utility sometimes produces meaningless messages and sometimes locks up. In my case it seemed to lock up every time I tried to perform more than one disk operation. I had to make one change then reboot then another change then reboot. Worse than Windows.

Do everything manually

A common suggestion is to do everything manually. Do not let Ubuntu create the components of the RAID array when creating the array. I will try again doing everything by hand.

Gparted

Gparted is documented as creating partitions for RAID but not the Gparted you get when you install Gparted on Ubuntu 11.4.

Webmin

Webmin will be my next test because this machine will have Webmin installed for regular use.