0%

Ubuntu 系统下查看硬盘信息的方法

方法一:直接通过内核查看

1
2
3
4
5
$ cat /sys/block/sdc/device/model
TOSHIBA Q300

$ cat /sys/block/sdc/device/vendor
ATA

方法二:用过hdparm命令查看

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
$ sudo hdparm -I /dev/sdc

/dev/sdc:

ATA device, with non-removable media
Model Number: TOSHIBA Q300
Serial Number: 95IB51YBKNSX
Firmware Revision: SAFM11.1
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
Supported: 9 8 7 6 5
Likely used: 9
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: 468862128
Logical Sector size: 512 bytes
Physical Sector size: 512 bytes
Logical Sector-0 offset: 0 bytes
device size with M = 1024*1024: 228936 MBytes
device size with M = 1000*1000: 240057 MBytes (240 GB)
cache/buffer size = unknown
Form Factor: 2.5 inch
Nominal Media Rotation Rate: Solid State Device
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = 16
Advanced power management level: 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:
* SMART feature set
Security Mode feature set
* Power Management feature set
* Write cache
* Look-ahead
* Host Protected Area feature set
* WRITE_BUFFER command
* READ_BUFFER command
* NOP cmd
* DOWNLOAD_MICROCODE
* Advanced Power Management feature set
SET_MAX security extension
* 48-bit Address feature set
* Mandatory FLUSH_CACHE
* FLUSH_CACHE_EXT
* SMART error logging
* SMART self-test
* General Purpose Logging feature set
* WRITE_{DMA|MULTIPLE}_FUA_EXT
* 64-bit World wide name
* {READ,WRITE}_DMA_EXT_GPL commands
* Segmented DOWNLOAD_MICROCODE
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Gen3 signaling speed (6.0Gb/s)
* Native Command Queueing (NCQ)
* Host-initiated interface power management
* Phy event counters
* Host automatic Partial to Slumber transitions
* Device automatic Partial to Slumber transitions
* READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
* DMA Setup Auto-Activate optimization
Device-initiated interface power management
* Software settings preservation
Device Sleep (DEVSLP)
* DOWNLOAD MICROCODE DMA command
* SET MAX SETPASSWORD/UNLOCK DMA commands
* WRITE BUFFER DMA command
* READ BUFFER DMA command
* Data Set Management TRIM supported (limit 8 blocks)
* Deterministic read ZEROs after TRIM
Security:
Master password revision code = 65534
supported
not enabled
not locked
frozen
not expired: security count
supported: enhanced erase
2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 500080dc002da6c1
NAA : 5
IEEE OUI : 00080d
Unique ID : c002da6c1
Checksum: correct
Device Sleep:
DEVSLP Exit Timeout (DETO): 100 ms (drive)
Minimum DEVSLP Assertion Time (MDAT): 31 ms (drive)

通过这种方法,看到的信息更全面,硬盘型号、序列号、容量、接口、转速等信息均可查看。

注意,可配合grep命令使用,快速查询自己需要的信息,如:

1
2
$ sudo hdparm -i /dev/sdc |grep "Model"
Model=TOSHIBA Q300, FwRev=SAFM11.1, SerialNo=95IB51YBKNSX

方法三:通过lsscsi工具查看

因为工具非系统自带,首先需要手动安装,安装和执行示例如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ sudo apt install lsscsi
The following NEW packages will be installed:
lsscsi
0 packages upgraded, 1 newly installed, 0 to remove and 36 not upgraded.
Need to get 35.6 kB of archives. After unpacking 105 kB will be used.
Get: 1 http://cn.archive.ubuntu.com/ubuntu/ trusty/main lsscsi amd64 0.27-2 [35.6 kB]
Fetched 35.6 kB in 7s (4,883 B/s)
Selecting previously unselected package lsscsi.
(Reading database ... 425107 files and directories currently installed.)
Preparing to unpack .../lsscsi_0.27-2_amd64.deb ...
Unpacking lsscsi (0.27-2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up lsscsi (0.27-2) ...

$ lsscsi --device
[0:0:0:0] disk ATA ST1000DM003-1ER1 CC45 /dev/sda [8:0]
[2:0:0:0] disk ATA WDC WD10EZEX-00B 1A01 /dev/sdb [8:16]
[3:0:0:0] disk ATA TOSHIBA Q300 11.1 /dev/sdc [8:32]
[6:0:0:0] disk WD My Passport 0820 1012 /dev/sdd [8:48]
[6:0:0:1] enclosu WD SES Device 1012 -

坚持原创技术分享,您的支持将鼓励我继续创作!