ldm_partition(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– ldm_partition(9) πŸ’–

hey bestie, welcome to ldm_partition(9) β€” straight from the Kernel API Manual. This one is literally the dynamic-disk detector/handler, and it's giving β€œI will check the device and then handle the partitions” energy. 🫢


✨ NAME ✨

ldm_partition β€” find out whether a device is a dynamic disk and handle it. okay so that's the whole assignment, and the function is doing it. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int ldm_partition (struct parsed_partitions *state );

🌸 ARGUMENTS 🌸

  • state β€” the partition check state, including the device holding the LDM Database. bestie, this is where the LDM Database info lives. πŸ—‚οΈ

πŸ¦‹ DESCRIPTION πŸ¦‹

So this determines whether the device bdev is a dynamic disk. If it is, it creates the partitions necessary in the gendisk structure pointed to by hd. no cap, that's the whole flow. ✨

It creates a dummy device 1, which contains the LDM database, and then it creates each partition described by the LDM database in sequence as devices 2+. For example, if the device is hda, we would have: hda1: LDM database, hda2, hda3, and so on: the actual data containing partitions. the way that numbering stacks up is honestly kind of iconic. πŸŽ€


πŸ”₯ RETURN πŸ”₯

Here's the return-value vibe check, bestie:

  • 1 β€” Success, state->disk is a dynamic disk and we handled it. slay. πŸ’…
  • 0 β€” Success, state->disk is not a dynamic disk. okay, no dynamic-disk situation here. 🫢
  • -1 β€” An error occurred before enough information had been read Or state->disk is a dynamic disk, but it may be corrupted. not the cute outcome, ngl. 😭

🌈 SEE ALSO 🌈

Kernel file ./block/partitions/ldm.c β€” and bestie, the whole LDM function family is right here, iykyk:


Source/version ./block/partitions β€’ dated October 2026 β€’ ldm_partition(9) is out, mwah πŸ’‹πŸ§š

πŸ“¦ where this page comes from