lsm_local...al_num_get(3)

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

✨ NAME ✨

lsm_local_disk_serial_num_get β€” bestie, we're getting the serial number πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int lsm_local_disk_serial_num_get (const char *disk_path, char
     **serial_num, lsm_error **lsm_err);

🌸 ARGUMENTS 🌸

  • disk_path β€” String, and it's literally the path of the disk path, like "/dev/sdb". Yes, the manpage says "path of disk path", we don't make the rules, we just pass them along 🫢
  • serial_num β€” Output pointer of the SCSI VPD80 serial number. It's NULL when there's an error. And the memory? Should be freed by free, no cap.
  • lsm_err β€” Output pointer of lsm_error. You can grab the error message via lsm_error_message_get, and the memory should be freed by lsm_error_free. Clean up after yourself, queen πŸ‘‘

πŸ’– VERSION πŸ’–

1.4 ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

So the whole vibe here is: you query the serial number of a specified disk path. That's the moment. 🌈

And for SCSI/SAS/SATA/ATA disks specifically, it will be extracted from the SCSI VPD 0x80 page. That's where the tea lives, iykyk πŸ“


πŸ”₯ RETURN πŸ”₯

Error code as enumerated by lsm_error_number:

  • LSM_ERR_OK β€” On success or not found. Yeah, "or not found" is right there, don't @ me 😭
  • LSM_ERR_INVALID_ARGUMENT β€” When any argument is NULL.
  • LSM_ERR_NO_MEMORY β€” When no memory. πŸ’€
  • LSM_ERR_LIB_BUG β€” When something unexpected happens. The library is giving... unhinged πŸ™ˆ
  • LSM_ERR_NOT_FOUND_DISK β€” When provided disk path not found.

Okay bestie, that's the whole page πŸ’œ Go forth and get those serial numbers, main character energy only πŸ‘‘

February 2026 energy, straight out of the Libstoragemgmt C API Manual β€” slay, bye πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from