lsm_local_disk_rpm_get(3)

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

✨ 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 β€” a String. 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 of int32_t. this is where the answer gets dropped off, so bring an actual variable for her to write into.
  • lsm_err β€” output pointer of lsm_error. if something goes sideways, the tea lives in here. you can pull the message out with lsm_error_message_get, and when you're done with it, free that memory with lsm_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 is NULL. 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