lsm_local..._type_get(3)

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

okay bestie, welcome to the lsm_local..._type_get(3) page πŸ’– this one is short, sweet, and literally just asks the kernel "hey girl, what kind of link is this disk on?" let's get into it πŸ¦‹


🌸 SYNOPSIS 🌸

int lsm_local_disk_link_type_get (const char *disk_path,
lsm_disk_link_type *link_type, lsm_error **lsm_err);

πŸŽ€ ARGUMENTS πŸŽ€

  • disk_path β€” a String, bestie. it's the path of the disk, like "/dev/sdb". that's the vibe.
  • link_type β€” output pointer of lsm_disk_link_type. this is where the answer gets dropped off 🫢
  • lsm_err β€” output pointer of lsm_error. the error message can be retrieved via lsm_error_message_get, and the memory should be freed by lsm_error_free. don't forget to free it, that's the rule πŸ’…

⭐ VERSION ⭐

1.3


πŸ’œ DESCRIPTION πŸ’œ

So what does this even do? it queries the disk link type of the specified disk path. no cap, that's it.

For SATA disks connected to SAS SES enclosure, it will return LSM_SCSI_LINK_TYPE_ATA. noted πŸ“

⚠️ heads up: this requires permission to open /dev/sdX β€” so root user or disk group, periodt. no permission, no tea β˜•

here's the possible value of lsm_disk_link_type, and honestly it's giving encyclopedia but make it cute 🧚:

  • LSM_DISK_LINK_TYPE_UNKNOWN β€” when error or unknown. the "idk her" option πŸ™ˆ
  • LSM_DISK_LINK_TYPE_FC β€” Fibre Channel.
  • LSM_DISK_LINK_TYPE_SSA β€” Serial Storage Architecture, Old IBM tech. vintage icon πŸ‘‘
  • LSM_DISK_LINK_TYPE_SBP β€” Serial Bus Protocol, used by IEEE 1394.
  • LSM_DISK_LINK_TYPE_SRP β€” SCSI RDMA Protocol.
  • LSM_DISK_LINK_TYPE_ISCSI β€” Internet Small Computer System Interface.
  • LSM_DISK_LINK_TYPE_SAS β€” Serial Attached SCSI.
  • LSM_DISK_LINK_TYPE_ADT β€” Automation/Drive Interface Transport Protocol, often used by Tape.
  • LSM_DISK_LINK_TYPE_ATA β€” PATA/IDE or SATA.
  • LSM_DISK_LINK_TYPE_USB β€” USB disk.
  • LSM_DISK_LINK_TYPE_SOP β€” SCSI over PCI-E.
  • LSM_DISK_LINK_TYPE_PCIE β€” PCI-E, e.g. NVMe. the fast one πŸ”₯

πŸ”₯ RETURN πŸ”₯

the error code comes back as enumerated by lsm_error_number, and here's the whole menu:

  • LSM_ERR_OK β€” On success. we ate πŸ’…
  • LSM_ERR_INVALID_ARGUMENT β€” When any argument is NULL.
  • LSM_ERR_NO_MEMORY β€” When no memory. πŸ’€
  • LSM_ERR_LIB_BUG β€” When something unexpected happens.
  • LSM_ERR_NOT_FOUND_DISK β€” When provided disk path not found.
  • LSM_ERR_PERMISSION_DENIED β€” Insufficient permission to access provided disk path. 😭

and that's the whole page, bestie 🫢 this was the lsm_local_disk_link_type_get page from the Libstoragemgmt C API Manual, dated February 2026, and the man page itself lives in section 3 as lsm_local..._type_get(3). go query some disks, drink water, and free your lsm_error πŸ’–βœ¨πŸŒˆ

πŸ“¦ where this page comes from