Respecting the Host Protected Area

Phillip Susi psusi at cfl.rr.com
Wed May 21 23:17:58 BST 2008


After chasing down the underlying cause of a bug a user reported with 
dmraid, I have found that the actual issue is a patch that was included 
in gutsy that defaults the HPA override to ON.  What this means is that 
if the bios has protected part of the disk so that the OS is not 
supposed to be aware of it, Ubuntu will ignore that protection and 
access the hidden part of the disk, by default.  This seems 
fundamentally broken.

I spoke with mjg briefly on irc and he informed me that this was done 
because the old ide disk driver was broken in this respect, in that it 
always ignored the HPA protection, thus some users ran into trouble when 
they had formatted the full capacity of the disk using the old, broken 
ide driver, then upgraded to using libata, which defaulted to respecting 
the protected area, thus cutting off part of the filesystem.

It seems to me that intentionally breaking libata to maintain 
compatibility with the older, broken driver is completely wrong headed. 
Other operating systems properly respect the protected area, so we 
should follow the standards, and the crowd, and do the same.

The problems that can be caused with defaulting to disable HPA ( the 
current Ubuntu default ) are:

1)  Very important data may be stored by the bios in that area, and 
modifying it could brick the motherboard, or cause other unexpected 
results.  I have heard of one vendor that places a custom system there 
that can very quickly boot up and play cds without having to wait for 
your main OS to boot.  This feature would become corrupted when 
installing Ubuntu.

2)  Formatting the disk and then attempting to access it from another OS 
that properly respects HPA ( such as windows or another linux distro, or 
simply installing a vanilla kernel ) will prevent the other OS from 
accessing it properly.

3)  It breaks dmraid since the bios places the metadata relative to the 
end of the disk, minus the protected area, then when dmraid runs, it 
sees the full disk and so does not find the metadata in the correct place.


The only problem with respecting HPA by default is that it can cause 
problems for users who have bios that uses HPA, formated their disk with 
an old kernel using the old ide driver, and then upgraded.  This can 
easily be worked around though by setting the module parameter directing 
it to go ahead and ignore HPA, which could be turned on by default when 
doing an upgrade.

Both choices will cause problems for some people, but I think we should 
clearly go with the option that causes fewer problems, AND is 
technically correct.




More information about the ubuntu-devel mailing list