Respecting the Host Protected Area
Ben Collins
ben.collins at ubuntu.com
Thu May 22 16:00:12 BST 2008
On Wed, 2008-05-21 at 18:17 -0400, Phillip Susi wrote:
> 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.
Without that patch, HPA could not be ignored at all. We defaulted it to
ignore HPA because that fixed a lot of users. Most people wanted to
ignore it anyway, since it is pretty legacy, and in a lot of cases it
was only meant to trick old BIOS's into using larger disks.
Also, HPA is not enforced by the BIOS, but by the harddrive itself, so
the BIOS could never decide to protect a portion of the disk. I've never
seen cases where the BIOS requires info to be stored on the disk
(perhaps in some very proprietary systems, but not normal x86 machines).
Fewer and fewer disks are using this. It used to be a way for OEM's to
protect recovery and diagnostic tools, but given the easy and frequent
replacement of harddrives, having these tools on a disk is becoming less
and less common, and protecting them with HPA, even less so.
>From my understanding, HPA is close to being a legacy type feature. This
is the first time I've heard of someone being affected by the alternate
issue (ignoring it when it needs to be honored), but we had literally
dozens of people sub'd to the bug where not ignoring HPA was causing
them problems. It was actually an RC bug. We couldn't release Gutsy
without this "feature".
The person in that bug report can very easily set the HPA to be honored,
and be on their way.
--
Ubuntu : http://www.ubuntu.com/
Linux1394: http://wiki.linux1394.org/
SwissDisk: http://www.swissdisk.com/
More information about the ubuntu-devel
mailing list