hd(4)

πŸ’– hd β€” the MFM/IDE hard disk situation πŸ’–

okay bestie, gather round, because this is the hd(4) page and it's literally the lore of how your IDE drives get their names. it's a kernel interfaces manual page, no cap. let's get into it. πŸ¦‹


✨ NAME ✨

hd β€” MFM/IDE hard disk devices 🫢


🌸 DESCRIPTION 🌸

so the hd* devices? they're block devices that let you access MFM/IDE hard disk drives in raw mode. like, straight to the metal, no filter, main character energy. πŸ’…

here's the drive-to-name mapping, memorize it, it's giving flashcard vibes:

  • the master drive on the primary IDE controller (major device number 3) is hda
  • the slave drive on that same controller is hdb
  • the master drive of the second controller (major device number 22) is hdc
  • and the slave on that one is hdd

periodt. that's the whole alphabet assignment, bestie. ✨


πŸŽ€ the naming scheme, explained (iykyk) πŸŽ€

general IDE block device names have the form hdX, or hdXP, where:

  • X is a letter denoting the physical drive
  • P is a number denoting the partition on that physical drive

the first form, just plain hdX, is what you use to address the whole drive. the entire thing. all of it. no crumbs left. πŸ‘‘

partition numbers get assigned in the order the partitions are discovered, and only nonempty, nonextended partitions actually get a number. okay but here's the plot twist:

partition numbers 1–4 are given to the four partitions described in the MBR (the "primary" partitions), regardless of whether they are unused or extended. so like, they get numbers even when they're doing nothing. silent but numbered. πŸ’€

which means the first logical partition will be hdX5. yes, it skips to 5. that's just how it is.

both DOS-type partitioning and BSD-disklabel partitioning are supported, so you're covered either way, bestie. 🌈

and the hard limit? you can have at most 63 partitions on an IDE disk. sixty-three. that's the ceiling. don't push it. 🚫


🧚 example time 🧚

for example:

  • /dev/hda refers to all of the first IDE drive in the system
  • /dev/hdb3 refers to the third DOS "primary" partition on the second one

see? the naming literally tells you everything. iconic honestly. πŸ’œ


πŸ”₯ how they get created πŸ”₯

they are typically created by:

mknod -m 660 /dev/hda b 3 0
mknod -m 660 /dev/hda1 b 3 1
mknod -m 660 /dev/hda2 b 3 2
...
mknod -m 660 /dev/hda8 b 3 8
mknod -m 660 /dev/hdb b 3 64
mknod -m 660 /dev/hdb1 b 3 65
mknod -m 660 /dev/hdb2 b 3 66
...
mknod -m 660 /dev/hdb8 b 3 72
chown root:disk /dev/hd*

look at those mknod lines and then the chown at the end doing its little cleanup moment. the way that last line just fixes all the ownership at once? obsessed. 🌟


πŸ“ FILES πŸ“

  • /dev/hd*

πŸ’€ SEE ALSO πŸ’€


and that's the page!! go forth and mknod responsibly, bestie. 🫢✨

sign-off time because i would never leave you without the receipts: this one's from the Linux man-pages 6.20, dated 2025-09-21, and it's page hd(4) of the Kernel Interfaces Manual. slay. πŸ’…πŸ’–πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: GPL-2.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms