ata_hpa_resize(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ata_hpa_resize β€” from the Kernel API Manual, bestie ✨

Okay so picture this: you're deep in libata land and there's a drive lying to you about how big it is. That's the HPA vibe. This lil function is the glow-up. πŸ¦‹


✨ SYNOPSIS ✨

int ata_hpa_resize(struct ata_device *dev);

That's it. One function, one pointer, one whole rescue mission. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device you're about to resize. Like, the one getting the makeover. Device to resize, no cap. πŸ’…

🌸 DESCRIPTION 🌸

So here's the tea β˜•: this function reads the size of an LBA28 or LBA48 disk that's got HPA features, and then β€” if it needs to β€” it resizes that thing to the full size of the media. Full send. The whole disk. Not the HPA-crunched version. πŸ”₯

⚠️ Listen bestie, this is the important part: the caller must check the drive has the HPA feature set enabled before calling this. This function isn't doing that vibe check for you. That's on you. πŸ™ˆ

πŸ’– RETURN πŸ’–

  • 0 on success β€” slay, it worked ✨
  • -errno on failure β€” it's giving error, we're sad 😭

🧚 SEE ALSO 🧚

The kernel file this lives in is ./drivers/ata/libata-core.c, and honestly the friend group is huge. Here's everybody: πŸ‘‘

That's the whole squad. Go read them. Or don't, I'm not your mom. πŸ’œ


Mwah πŸ’‹ β€” this page came out of ./drivers/ata and it's dated October 2026. Byeee, go resize something responsibly! πŸŽ€

πŸ“¦ where this page comes from