lsm_local_disk_list(3)
π 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β anlsm_string_listpointer, 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 oflsm_error. wanna know what went wrong? grab the message withlsm_error_message_get. and yes, you clean it up withlsm_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 isNULL. 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 aNULLargument and you're gettingLSM_ERR_INVALID_ARGUMENTback, 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
- fedora 43: libstoragemgmt-devel 1.10.3-1.fc43 Β· LGPL-2.1-or-later
- fedora 44: libstoragemgmt-devel 1.10.3-1.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms