GENHD CAPABILITY FLAGS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… genhd capability flags (9)

okay so this is a Kernel API Manual page, bestie, and it's literally all about the capability flags for genhd β€” the block-device generation stuff. it's short, it's sweet, and every one of these flags is doing main character work. let's get into it ✨


🌸 DESCRIPTION 🌸

these are the flags that tell the kernel how a block device should behave. three of them, three vibes, all iconic πŸ‘‘

  • GENHD_FL_REMOVABLE β€” this one says the block device gives you access to removable media. and here's the tea 🍡: when it's set, the device stays present even when there's no media inserted. it's giving "the slot is still there even though the disc isn't." shall not be set for devices that get removed entirely when the media is removed β€” like, if the whole thing dips when the media goes, this flag is not for you, periodt πŸ’€
  • GENHD_FL_HIDDEN β€” the block device is hidden πŸ™ˆ. it doesn't produce events, it doesn't appear in sysfs, and it can't be opened from userspace or by using blkdev_get*. sneaky little thing. it's used for the underlying components of multipath devices, iykyk πŸŒ€
  • GENHD_FL_NO_PART β€” partition support is disabled 🚫. the kernel will not scan for partitions from add_disk, and users can't add partitions manually either. no partitions, not now, not ever, no cap πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, bestie, they're all in the kernel file ./include/linux/blkdev.h:


✨ that's the whole page, you ate that ✨ this one lives under ./include/linux, and the version/date stamp on it is October 2026 πŸŽ€ mwah, go touch some block devices (safely) 🫢

πŸ“¦ where this page comes from