从 df 设备名称到物理驱动器名称(供应商/类型)

从 df 设备名称到物理驱动器名称(供应商/类型)

通过 df 查看设备名称,是否可以通过某种方式将其解析为物理驱动器名称,例如供应商/类型

/dev/sda3               915.4G     34.9G    880.0G   4% /share/HDA_DATA
/dev/sdd3                 1.8T    668.1G      1.1T  36% /share/HDD_DATA

我了解到我找到了一些信息系统/块,但我在那里没有找到供应商的类型名称?

- 添加 -

我的系统是基于 Linux 的 QNAP NAS,因此情况可能会略有不同。

-- 根据史蒂文的回答添加 --

[~] # hdparm -I /dev/sdb3

/dev/sdb3:
 HDIO_DRIVE_CMD(identify) failed: Invalid argument

答案1

sudo lshw -class disk
  *-cdrom                 
       description: DVD-RAM writer
       product: CDDVDW SH-S223Q
       vendor: TSSTcorp
       physical id: 0
       bus info: scsi@0:0.0.0
       logical name: /dev/cdrom
       logical name: /dev/cdrw
       logical name: /dev/dvd
       logical name: /dev/dvdrw
       logical name: /dev/sr0
       version: SB02
       capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
       configuration: ansiversion=5 status=ready
     *-medium
          physical id: 0
          logical name: /dev/cdrom
  *-disk
       description: ATA Disk
       product: WDC WD1600AAJS-0
       vendor: Western Digital
       physical id: 1
       bus info: scsi@1:0.0.0
       logical name: /dev/sda
       version: 01.0
       serial: WD-WMAV2P964464
       size: 149GiB (160GB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 signature=000c0805
  *-disk
       description: SCSI Disk
       physical id: 0.0.0
       bus info: scsi@6:0.0.0
       logical name: /dev/sdb
       size: 931GiB (1TB)
       capabilities: partitioned partitioned:dos
       configuration: signature=a39eabc7

答案2

QNAP NAS 产品运行的固件本质上是一个定制的 Linux 发行版。它非常简洁,具有最少的命令行工具集(其中许多是由 提供的busybox)。幸运的是,那里有一个不错的实现hdparm,因此您应该能够查询驱动器,如下所示:

hdparm -I /dev/sda

以下是我从带有“Western Digital RE4 1TB”驱动器的“QNAP TS-239 Pro NAS”获得的输出(输出是逐字的,除了驱动器的序列号,我故意遮盖了它):

/dev/sda:

ATA device, with non-removable media
    Model Number:       WDC WD1003FBYX-01Y7B0                   
    Serial Number:      AB-CDEF01234567
    Firmware Revision:  01.01V01
Standards:
    Supported: 8 7 6 5 
    Likely used: 8
Configuration:
    Logical     max current
    cylinders   16383   16383
    heads       16  16
    sectors/track   63  63
    --
    CHS current addressable sectors:   16514064
    LBA    user addressable sectors:  268435455
    LBA48  user addressable sectors: 1953525168
    device size with M = 1024*1024:      953869 MBytes
    device size with M = 1000*1000:     1000204 MBytes (1000 GB)
Capabilities:
    LBA, IORDY(can be disabled)
    Queue depth: 32
    Standby timer values: spec'd by Standard, with device specific minimum
    R/W multiple sector transfer: Max = 16  Current = 0
    Advanced power management level: unknown setting (0x0080)
    Recommended acoustic management value: 128, current value: 254
    DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
         Cycle time: min=120ns recommended=120ns
    PIO: pio0 pio1 pio2 pio3 pio4 
         Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
    Enabled Supported:
       *    NOP cmd
       *    READ BUFFER cmd
       *    WRITE BUFFER cmd
       *    Host Protected Area feature set
       *    Look-ahead
       *    Write cache
       *    Power Management feature set
            Security Mode feature set
       *    SMART feature set
       *    FLUSH CACHE EXT command
       *    Mandatory FLUSH CACHE command 
       *    Device Configuration Overlay feature set 
       *    48-bit Address feature set 
       *    Automatic Acoustic Management feature set 
            SET MAX security extension
       *    SET FEATURES subcommand required to spinup after power up
            Power-Up In Standby feature set
       *    Advanced Power Management feature set
       *    DOWNLOAD MICROCODE cmd
       *    General Purpose Logging feature set
       *    SMART self-test 
       *    SMART error logging 
Security: 
    Master password revision code = 65534
        supported
    not enabled
    not locked
    not frozen
    not expired: security count
        supported: enhanced erase
    168min for SECURITY ERASE UNIT. 168min for ENHANCED SECURITY ERASE UNIT.
Checksum: correct

未明确报告“供应商”和“类型” hdparm。然而,“型号”据报道,快速进行网络搜索应该会产生您需要了解的有关驱动器的任何信息。

答案3

大多数现代 Linux 系统都使用乌德夫来管理设备。但并非所有嵌入式设备都是如此。我不知道这个特定设备是否使用udev。

udevadm info -n /dev/sda3 -a
udevadm info -n /dev/sda3 -q property

将打印系统知道的所有内容/dev/sda3。这与您在 中找到的信息相同/sys,但 udev 会沿着层次结构向下移动以收集所有数据。

答案4

我也有这个问题。我发现命令:

/sbin/get_hd_smartinfo

当没有 args 运行时打印使用指南。

要将磁盘号连接到设备,请像这样使用:

/sbin/get_hd_smartinfo -d 2 -i 1

按 ctrl-c 终止,它将打印“将文件保存到 /tmp/sdX_smart_zzzzzzz”,其中 sdX 是您的设备。

[/var/log] # /sbin/get_hd_smartinfo -d 2 -i 1 
001 Raw_Read_Error_Rate          215244560 119 099 006 OK
...
242 Lifetime_Reads_To_Host       23449824883497 100 253 000 OK
^CCatch interrupt Singal,Interrupt ..
Save file to /tmp/sdb_smart_563ffc1c

相关内容