From df device name to physical drive name (vendor / type)
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
The QNAP NAS products run firmware that is essentially a custom Linux distro. It is quite spartan, with a minimal set of command line tools (and many of those provided by busybox
). Fortunately, there is a decent implementation of hdparm
in there, so you should be able to query a drive, as follows:
hdparm -I /dev/sda
Here's the output I get from a "QNAP TS-239 Pro NAS" with a "Western Digital RE4 1TB" drive (output is verbatim, except for the drive's serial number, which I have purposely obscured):
/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
"Vendor" and "Type" are not explicitly reported by hdparm
. However, "Model Number" is reported, and a quick web search on it should yield anything you need to know about a drive.
Most modern Linux systems use udev to manage devices. This isn't the case on all embedded devices though; I don't know whether this specific device uses udev.
udevadm info -n /dev/sda3 -a
udevadm info -n /dev/sda3 -q property
will print everything the system knows about /dev/sda3
. This is the same info you'll find in /sys
, but udev does the work of walking down the hierarchy to collect all the data.