What is HPA?HPA (Host Protected Area) is a 'feature' (read: curse) of certain motherboards that is supposed to help recover from a corrupted BIOS. At the time of this writing (Feb. 2011), only certain older Gigabyte motherboards are known to force an HPA on hard drives. I don't know the exact cut-off date, but if you are using a Gigabyte motherboard manufactured before 2010 then you should definitely check to see if you have HPA on any of your drives. Also, it is definitely possible to have an HPA from a previous motherboard. If a drive has at any point in time been used with one of these HPA-inducing boards, then there's a good chance that it still has a vestigial HPA, even if it has been formatted since.
What is the danger?HPA essentially shrinks the capacity of the drive. As far as unRAID or any other OS is concerned, the drive is now smaller than it used to be. In short, this causes your unRAID array to be unreliable in the event of a disk failure. Read on to see why.
Let's consider an example. Say you are building a new server out of a mixture of 1 TB drives and an old Gigabyte motherboard that has HPA enabled by default. Say your parity drive is a 1 TB drive with a capacity of 1953525168 sectors. All your data drives must be 1953525168 sectors or smaller. As the motherboard boots for the first time, it will first search all the disks connected directly to it via the onboard SATA ports (not on disks connected via a SATA expansion card) for an HPA containing a current copy of its BIOS. Since this is a brand new build, it won't find one. It will then create an HPA on the first drive that initialized. This isn't dependent on the number of the SATA port (SATA0, SATA1, etc.). This may or may not be the parity drive, it depends on how long each drive took to initialize. If there are six drives connected to the motherboard, any one of those six could be a potential target for an HPA. Let's say for example that the motherboard chooses the parity drive for its HPA. The parity drive now reports a size of 1953523055 sectors to unRAID, instead of its native size of 1953525168 sectors. All of a sudden the parity drive is not the largest drive in the array, at least from unRAID's point of view, and the 1 TB drive is an invalid candidate for parity. This is about the best possible scenario, since as this is a new build it would be fairly easy to identify the problem and rectify it.
Now let's consider the worst possible scenario. Say you built the server above and just allowed the HPA to reside on one or more of your data disks. As long as the parity disk is the largest, unRAID will still function normally even if multiple disks have an HPA. For this example let's say that your array has only one disk with an HPA - disk1. The parity and all the other data disks are HPA free. Every time the server boots the motherboard searches for an HPA, finds it on disk1, and then contented it takes no further action. Then..disaster strikes - disk1 fails. You shut down the server, replace disk1 with another 1 TB drive, then boot up expecting to be able to recover disk1's contents onto the new disk. Alas, you are greeted with a 'parity is not the largest disk' message. What happened? When you booted the server after replacing the failed disk, the motherboard again searched for a valid HPA, but this time didn't find one, as disk1 was no longer present. So it created a new HPA on another disk, which just so happened to be your parity disk. Your array is now essentially missing two disks - disk1 has failed, and the former parity disk is now smaller than it should be, so it isn't a valid parity disk. At this point you would be unable to recover the data from disk1 without the careful guided help from members of this forum. Even with that help, there's still a chance of permanent data loss.
How will I know it when I see it?HPA goes by many names in the BIOS settings. It has been called:
- Save a Copy of BIOS to HDD
- BIOS Backup
- Backup BIOS to HDD
- Xpress BIOS Rescue
...and I'm sure there are other names as well
unRAID identifies any HPA it finds in the syslog. It looks like this:
Feb 8 07:41:22 Tower kernel: sd 1:0:0:0: [sda] Attached SCSI disk
Feb 8 07:41:22 Tower kernel: ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
Feb 8 07:41:22 Tower kernel: ata2.00: HPA detected: current 1953523055, native 1953525168
Feb 8 07:41:22 Tower kernel: ata2.00: ATA-7: SAMSUNG HD103UJ, 1AA01118, max UDMA7
Feb 8 07:41:22 Tower kernel: ata2.00: 1953523055 sectors, multi 16: LBA48 NCQ (depth 31/32)
Feb 8 07:41:22 Tower kernel: ata2.00: configured for UDMA/100
So you can always just search your syslog for the phrase 'HPA' to see if you have any in your system.
I've identified one or more HPAs in my array, what can I do about it?For the short term, you can see if you can disable the BIOS feature that is creating a Host-Protected-Area on your disks. This is NOT a good solution since some day, when your CMOS battery dies, the feature will re-enable itself, and it WILL change the size of one of your disks, and it will cause you to all kinds of grief.
If you cannot disable the feature, you basically either need to get a different motherboard, or a BIOS upgrade. The newest of Gigabyte BIOS have the feature disabled by default. This is what you want. The older of Gigabyte BIOS have no way to disable the feature, those are not acceptable for unRAID use (or ANY raid use for that matter)
Then, you need to remove the HPA from your parity drive. This will them make it appear as its correct full size.
Do not be fooled into thinking just disabling the feature in the BIOS is enough... It must be disabled by default. Other unRAID users have actually swapped out motherboards because the feature either was not disabled by default, or could not be disabled at all.
How do I remove HPA from a drive?The HDAT2 Method (requires the ability to hook up a CD drive to your server - an external optical drive is fine)
HDAT2 GuideThe hdparm -N method (uses either the unRAID system console or telnet)
hdparm -N GuideMore InfoWiki HPA TopicSpecial Note regarding unRAID 4.7If you are upgrading from unRAID 4.6 (or below) to unRAID 4.7 (or above) you
MUST remove any HPAs on any of your drives
BEFORE the upgrade can be successful. See
this thread for more information.