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) ishda - the slave drive on that same controller is
hdb - the master drive of the second controller (major device number
22) ishdc - 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:
Xis a letter denoting the physical drivePis 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 numbers1β4are 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/hdarefers to all of the first IDE drive in the system/dev/hdb3refers 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