lsm_local_disk_list(3)

πŸ“¦
version 1.10.3 Β· 3 versions
, in fedora 43, fedora 44

πŸ’– lsm_local_disk_list β€” the Libstoragemgmt C API Manual, bestie edition πŸ’–

okay so you're here for lsm_local_disk_list(3) from the Libstoragemgmt C API Manual and honestly? good taste. it's a little function that spills the tea on every local disk your machine is holding. let's get into it πŸ¦‹


✨ NAME ✨

lsm_local_disk_list β€” Query local disks.

like. it queries. your local disks. that's the whole job and it does it flawlessly πŸ’…


✨ SYNOPSIS ✨

int lsm_local_disk_list (lsm_string_list **disk_paths, lsm_error
**lsm_err);

✨ ARGUMENTS ✨

  • disk_paths β€” an lsm_string_list pointer, okay? and the format of the disk path strings is very specific, no cap:
    • "/dev/sd[a-z]+" for SCSI and ATA disks
    • "/dev/nvme[0-9]+n[0-9]+" for NVMe disks

and here's the cute part: if there's literally no disk found, you still get an empty lsm_string_list back β€” not NULL, empty. empty is not NULL bestie, they are different. πŸ™ˆ and when you're done with it, you free that memory with lsm_string_list_free.

  • lsm_err β€” the output pointer of lsm_error. wanna know what went wrong? grab the message with lsm_error_message_get. and yes, you clean it up with lsm_error_free. free your things, it's self care 🌸

✨ VERSION ✨

1.3


✨ DESCRIPTION ✨

Query local disk paths. and rn, currently, only these disk types get an invite to the party: SCSI, SAS, ATA and NVMe. everyone else is outside. πŸŽ€


✨ RETURN ✨

the error code comes back as enumerated by lsm_error_number, and here's the full lineup:

  • LSM_ERR_OK β€” on success, or when nothing was found. either way we're chill πŸ’œ
  • LSM_ERR_INVALID_ARGUMENT β€” when any argument is NULL. don't do that 😭
  • LSM_ERR_NO_MEMORY β€” when there's no memory. tragic. iconic of the machine to do that to you πŸ’€
  • LSM_ERR_LIB_BUG β€” when something unexpected happens. and honestly? when something unexpected happens we simply do not know what to say 🫢
heads up: pass a NULL argument and you're getting LSM_ERR_INVALID_ARGUMENT back, that's not a vibe, that's a fact.

and that's the whole page!! you ate this. go call lsm_string_list_free and lsm_error_free before you leave though β€” main character energy includes freeing your memory πŸ’–βœ¨

source + version: this page is from Libstoragemgmt β€” well, the Libstoragemgmt C API Manual β€” and the function itself is rockin' version 1.3 🌈

dated February 2026, which means this manpage is fresh, it's current, it's giving brand new. periodt. πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from