lsm_local_disk_serial_num_get - Man Page

Query 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. The path of disk path, example "/dev/sdb".

serial_num

Output pointer of SCSI VPD80 serial number. NULL when error. Memory should be freed by free.

lsm_err

Output pointer of lsm_error. Error message could be retrieved via lsm_error_message_get. Memory should be freed by lsm_error_free.

Version

1.4

Description

Query the serial number of specified disk path. For SCSI/SAS/SATA/ATA disks, it will be extracted from SCSI VPD 0x80 page.

Return

Error code as enumerated by 'lsm_error_number':
   * LSM_ERR_OK
       On success or not found.
   * 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.

Info

July 2024 Libstoragemgmt C API Manual