列出每个 sd 是什么

列出每个 sd 是什么

在Linux上我知道sda、sdb和sdh是硬盘驱动器,但我不知道sdc、sdd、sde、sdf和sdg是什么。其中一些(我认为)是空的,而其中一些,内核试图让它们旋转但没有成功

有没有命令可以知道这些背后有什么?

$ lsblk -l | grep sd
sda         8:0    0   120G  0 disk 
sda2        8:2    0   110M  0 part /home/user/sda2
sda4        8:4    0   100M  0 part 
sda7        8:7    0    10G  0 part /home/user/sda7
sda8        8:8    0    10G  0 part /home/user/sda8
sdb         8:16   0    60T  0 disk 
sdb1        8:17   0    60T  0 part /home/user/sdb1
sdc         8:32   1     0B  0 disk 
sdd         8:48   1     0B  0 disk 
sde         8:64   1     0B  0 disk 
sdf         8:80   1     0B  0 disk 
sdg         8:96   1     0B  0 disk 
sdh         8:112  0    70G  0 disk 
sdh1        8:113  0    40G  0 part /home/user/sdh1
sdh2        8:114  0    30G  0 part /home/user/sdh2
$ grep . /sys/block/sd*/device/model
/sys/block/sdc/device/model:STORAGE DEVICE  
/sys/block/sdd/device/model:STORAGE DEVICE  
/sys/block/sde/device/model:STORAGE DEVICE  
/sys/block/sdf/device/model:STORAGE DEVICE  
/sys/block/sdg/device/model:STORAGE DEVICE
$ journalctl -b | egrep sd.\]
kernel: sd 6:0:0:3: [sdf] Attached SCSI removable disk
kernel: sd 6:0:0:1: [sdd] Attached SCSI removable disk
kernel: sd 6:0:0:2: [sde] Attached SCSI removable disk
kernel: sd 6:0:0:0: [sdc] Attached SCSI removable disk
kernel: sd 6:0:0:4: [sdg] Attached SCSI removable disk
kernel: sd 6:0:0:3: [sdf] Spinning up disk...
kernel: sd 6:0:0:0: [sdc] Spinning up disk...
kernel: sd 6:0:0:2: [sde] Spinning up disk...
kernel: sd 6:0:0:1: [sdd] Spinning up disk...
[indefinidely]
kernel: sd 6:0:0:2: [sde] Read Capacity(10) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
kernel: sd 6:0:0:2: [sde] Sense Key : Not Ready [current] 
kernel: sd 6:0:0:2: [sde] Add. Sense: Logical unit is in process of becoming ready
[/indefinidely]

答案1

我为此使用 inxi,它提供了一个相当完整的方便报告,具体取决于所选的详细级别(-x、-xx、-xxx 或 -a)。此外,除了 sd 之外,还有其他驱动器类型,还有 hd、fio、nvme、mmcblk 等。这些数据的来源因 GNU/Linux 还是 BSD 而异,有些是内部生成的(如供应商),有些来自系统。

基本报告(-d 将光驱添加到 -D 驱动器报告中,-z 过滤掉敏感信息,-y 使报告宽 80 列):

inxi -dzy
Drives:
  Local Storage: total: raw: 16.41 TiB usable: 9.13 TiB used: 1.23 TiB (13.5%) 
  ID-1: /dev/nvme0n1 vendor: Patriot model: Viper M.2 VPN100 size: 476.94 GiB 
  ID-2: /dev/nvme1n1 vendor: Patriot model: Viper M.2 VPN100 size: 953.87 GiB 
  ID-3: /dev/nvme2n1 vendor: Samsung model: SSD 960 EVO 250GB size: 232.89 GiB 
  ID-4: /dev/nvme3n1 vendor: Samsung model: SSD 960 EVO 250GB size: 232.89 GiB 
  ID-5: /dev/sda vendor: Seagate model: ST2000VN004-2E4164 size: 1.82 TiB 
  ID-6: /dev/sdb vendor: Seagate model: ST2000VN004-2E4164 size: 1.82 TiB 
  ID-7: /dev/sdc vendor: Seagate model: ST2000VN004-2E4164 size: 1.82 TiB 
  ID-8: /dev/sdd vendor: Seagate model: ST2000VN004-2E4164 size: 1.82 TiB 
  ID-9: /dev/sde vendor: Seagate model: ST2000VN004-2E4164 size: 1.82 TiB 
  ID-10: /dev/sdf vendor: Seagate model: ST2000VN004-2E4164 size: 1.82 TiB 
  ID-11: /dev/sdg vendor: Seagate model: ST2000VN004-2E4164 size: 1.82 TiB 
  ID-12: /dev/sdh vendor: Seagate model: ST2000VN004-2E4164 size: 1.82 TiB 
  Message: No optical or floppy data found.

更完整的报告,不同的系统(带有-xxx):

inxi -dxxxyz
Drives:
  Local Storage: total: 2.89 TiB used: 1.8 TiB (62.3%) 
  ID-1: /dev/sda vendor: Western Digital model: WD1003FZEX-00MK2A0 
  size: 931.51 GiB speed: 6.0 Gb/s rotation: 7200 rpm serial: <filter> 
  rev: 1A01 temp: 36.0 C scheme: GPT 
  ID-2: /dev/sdb vendor: Intel model: SSDSC2BW180A4 size: 167.68 GiB 
  speed: 6.0 Gb/s rotation: SSD serial: <filter> rev: DC32 temp: 33.0 C 
  scheme: MBR 
  ID-3: /dev/sdc vendor: Western Digital model: WD1001FALS-00E8B0 
  size: 931.51 GiB speed: 3.0 Gb/s rotation: 7200 rpm serial: <filter> 
  rev: 0K05 temp: 44.0 C scheme: GPT 
  ID-4: /dev/sdd vendor: Crucial model: CT1000MX500SSD4 size: 931.51 GiB 
  speed: 6.0 Gb/s rotation: SSD serial: <filter> rev: 023 temp: 48.0 C 
  scheme: GPT 
  Optical-1: /dev/sr0 vendor: HL-DT-ST model: DVDRAM GH20LS10 rev: FL00 
  dev-links: cdrom,cdrw,dvd,dvdrw 
  Features: speed: 48 multisession: yes audio: yes dvd: yes 
  rw: cd-r,cd-rw,dvd-r,dvd-ram state: running

完整报告(使用 -a 和 sudo,它还显示每个驱动器的 smartctl 结果):

sudo inxi -dayz
Drives:
  Local Storage: total: 2.89 TiB used: 1.8 TiB (62.3%) 
  ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital 
  model: WD1003FZEX-00MK2A0 family: Black size: 931.51 GiB block-size: 
  physical: 4096 B logical: 512 B sata: 3.1 speed: 6.0 Gb/s rotation: 7200 rpm 
  serial: <filter> rev: 1A01 temp: 36.0 C scheme: GPT 
  SMART: yes state: enabled health: PASSED on: 289d 18h cycles: 1230 
  ID-2: /dev/sdb maj-min: 8:16 vendor: Intel model: SSDSC2BW180A4 
  family: 53x and Pro 1500/2500 Series SSDs size: 167.68 GiB block-size: 
  physical: 512 B logical: 512 B sata: 3.0 speed: 6.0 Gb/s rotation: SSD 
  serial: <filter> rev: DC32 temp: 33.0 C scheme: MBR 
  SMART: yes state: enabled health: PASSED on: 1y 75d 22h cycles: 2034 
  read: 657.66 GiB written: 1.29 TiB 
  ID-3: /dev/sdc maj-min: 8:32 vendor: Western Digital 
  model: WD1001FALS-00E8B0 family: Caviar Black size: 931.51 GiB block-size: 
  physical: 512 B logical: 512 B sata: 2.5 speed: 3.0 Gb/s rotation: 7200 rpm 
  serial: <filter> rev: 0K05 temp: 44.0 C scheme: GPT 
  SMART: yes state: enabled health: PASSED on: 1y 77d 10h cycles: 1781 
  ID-4: /dev/sdd maj-min: 8:48 vendor: Crucial model: CT1000MX500SSD4 
  family: Micron Client SSDs size: 931.51 GiB block-size: physical: 4096 B 
  logical: 512 B sata: 3.3 speed: 6.0 Gb/s rotation: SSD serial: <filter> 
  rev: 023 temp: 48.0 C scheme: GPT 
  SMART: yes state: enabled health: PASSED on: 163d 8h cycles: 649 
  written: 1.27 TiB 
  Optical-1: /dev/sr0 vendor: HL-DT-ST model: DVDRAM GH20LS10 rev: FL00 
  dev-links: cdrom,cdrw,dvd,dvdrw 
  Features: speed: 48 multisession: yes audio: yes dvd: yes 
  rw: cd-r,cd-rw,dvd-r,dvd-ram state: running

采用字段名:值格式的完整报告(使用 -y1):

sudo inxi -dazy1
Drives:
  Local Storage: 
    total: 2.89 TiB
    used: 1.8 TiB (62.3%)
  ID-1: /dev/sda
    maj-min: 8:0
    vendor: Western Digital
    model: WD1003FZEX-00MK2A0
    family: Black
    size: 931.51 GiB
    block-size: 
      physical: 4096 B
      logical: 512 B
    sata: 3.1
    speed: 6.0 Gb/s
    rotation: 7200 rpm
    serial: <filter>
    rev: 1A01
    temp: 36.0 C
    scheme: GPT
    SMART: yes
      state: enabled
      health: PASSED
      on: 289d 18h
      cycles: 1230
  ID-2: /dev/sdb
    maj-min: 8:16
    vendor: Intel
    model: SSDSC2BW180A4
    family: 53x and Pro 1500/2500 Series SSDs
    size: 167.68 GiB
    block-size: 
      physical: 512 B
      logical: 512 B
    sata: 3.0
    speed: 6.0 Gb/s
    rotation: SSD
    serial: <filter>
    rev: DC32
    temp: 33.0 C
    scheme: MBR
    SMART: yes
      state: enabled
      health: PASSED
      on: 1y 75d 22h
      cycles: 2034
      read: 657.66 GiB
      written: 1.29 TiB
  ID-3: /dev/sdc
    maj-min: 8:32
    vendor: Western Digital
    model: WD1001FALS-00E8B0
    family: Caviar Black
    size: 931.51 GiB
    block-size: 
      physical: 512 B
      logical: 512 B
    sata: 2.5
    speed: 3.0 Gb/s
    rotation: 7200 rpm
    serial: <filter>
    rev: 0K05
    temp: 44.0 C
    scheme: GPT
    SMART: yes
      state: enabled
      health: PASSED
      on: 1y 77d 10h
      cycles: 1781
  ID-4: /dev/sdd
    maj-min: 8:48
    vendor: Crucial
    model: CT1000MX500SSD4
    family: Micron Client SSDs
    size: 931.51 GiB
    block-size: 
      physical: 4096 B
      logical: 512 B
    sata: 3.3
    speed: 6.0 Gb/s
    rotation: SSD
    serial: <filter>
    rev: 023
    temp: 48.0 C
    scheme: GPT
    SMART: yes
      state: enabled
      health: PASSED
      on: 163d 8h
      cycles: 649
      written: 1.27 TiB
  Optical-1: /dev/sr0
    vendor: HL-DT-ST
    model: DVDRAM GH20LS10
    rev: FL00
    dev-links: cdrom,cdrw,dvd,dvdrw
    Features: 
      speed: 48
      multisession: yes
      audio: yes
      dvd: yes
      rw: cd-r,cd-rw,dvd-r,dvd-ram
      state: running

答案2

磁盘已卸载,如果要查看信息则使用:

lsblk -o MODEL,TRAN,VENDOR,NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MAJ:MIN,TYPE,STATE,SUBSYSTEMS

或者

sudo lshw -class disk

相关内容