How to query whether a disk is an SSD disk or a SAS disk according to osdid
In this issue, the editor will bring you about how to query whether the disk is an SSD disk or a SAS disk according to osdid. The article is rich in content and analyzes and describes it from a professional point of view. I hope you can get something after reading this article.
Prerequisites:
1. Install the Megacli package for LSI
two。 Install the query tool lsscsi for scsi devices
Apt-get install lsscsi steps:
1. Find the drive letter according to osdid
Ceph-disk list | grep-A1-B1 osd.0 | egrep "^ / dev/sd*\ b" | cut-d':'- F1
two。 Find the target id of the device according to the drive letter
Lsscsi | grep / dev/sdd | awk'{print $1}'| cut-d':'- f3
3. Determine if the disk is a sas disk:
Execute the following command to return 2
. / MegaCli-LdPdInfo-aAll | grep-A 69 "Target Id: 3"\ | egrep'(PD Type: SAS | Media Type: Hard Disk Device)'| wc-l
4. Determine whether the disk is the ssd of the sata interface:
Execute the following command to return 2
. / MegaCli-LdPdInfo-aAll | grep-A 69 "Target Id: 6"\ | egrep'(PD Type: SATA | Media Type: Solid State Device)'| wc-l
The above is the editor for you to share how to query the disk according to osdid SSD disk or SAS disk, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.