lsm_local_disk_rpm_get(3)
β¨ lsm_local_disk_rpm_get β¨
okay bestie, welcome to the Libstoragemgmt C API Manual π today we're learning about lsm_local_disk_rpm_get β she's a little function from the Libstoragemgmt C API and she exists for exactly one glorious purpose: telling you how fast your disk is spinning. no cap.
πΈ NAME πΈ
lsm_local_disk_rpm_get β query disk rotation speed. that's it. that's the whole job. π
π SYNOPSIS π
int lsm_local_disk_rpm_get (const char *disk_path, int32_t *rpm,
lsm_error **lsm_err);
π¦ ARGUMENTS π¦
disk_pathβ aString. it's the path of your disk block, like"/dev/sdb"or"/dev/nvme0n1". just hand her the address and she'll go look πrpmβ output pointer ofint32_t. this is where the answer gets dropped off, so bring an actual variable for her to write into.lsm_errβ output pointer oflsm_error. if something goes sideways, the tea lives in here. you can pull the message out withlsm_error_message_get, and when you're done with it, free that memory withlsm_error_freeβ don't leave her hanging, that's rude π«Ά
π VERSION π
1.3
π DESCRIPTION π
So what does she actually do? She queries the disk rotation speed β that's revolutions per minute (RPM) β of the disk path you specified. simple, iconic, efficient.
Heads up bestie: this needs permission to open the disk path. so you gotta be root, or be in the disk group. no permission, no RPM. periodt. π
Here's the vibe check on what rpm can come back as:
-1(LSM_DISK_RPM_UNKNOWN) β unknown RPM. she simply does not know. π€·0(LSM_DISK_RPM_NON_ROTATING_MEDIUM) β non-rotating medium, e.g. an SSD. no spinny parts, still slaying. β¨1(LSM_DISK_RPM_ROTATING_UNKNOWN_SPEED) β it IS a rotational disk, but the speed is unknown. she's spinning, she's just not telling us how fast. π>1β a normal rotational disk, e.g. an HDD. classic. the icon. the moment. π
π RETURN π
Error code, as enumerated by lsm_error_number:
LSM_ERR_OKβ on success or not found. (yes, both. she's chill like that. π)LSM_ERR_INVALID_ARGUMENTβ when any argument isNULL. don't pass her nothing, bestie.LSM_ERR_LIB_BUGβ when something unexpected happens. π not our fault, it's giving library bug energy.LSM_ERR_NOT_FOUND_DISKβ when the disk path you provided isn't found. she looked. it wasn't there. πLSM_ERR_PERMISSION_DENIEDβ no sufficient permission to access the disk path you provided. see the root/disk-group situation above. π
and that's the whole page, bestie!! π this little legend ships with the Libstoragemgmt C API Manual, version 1.3, and this particular copy is dated February 2026. go forth and query those RPMs, you absolute main character. mwah π
πβ¨
π¦ 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