Как узнать информацию о дисках в системе

Как узнать информацию о дисках в системе

Roman Bogachev VMware Specialist | Drone Pilot | Traveler

Простой и быстрый способ узнать какие диски установлены в вашей Linux системе

Утилита LSHW

Утилита lshw (Linux Hardware Lister) предназначена для получения детальной информации о компонентах сервера: процессоре, конфигурации оперативной памяти, материнской плате, BIOS информацию, конфигурацию кэша, шины и многое другое (в комплекте с утилитой также имеется база данных оборудования с USB и PCI интерфейсами).

Утилита отсутствует в стандартном наборе, поэтому установку производим самостоятельно, для RHEL достаточно выполнить yum install lshw -y

Для того, чтобы получить информацию о дисковых устройствах системы, выполним команду lshw -class disk -class storage:

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
# lshw -class disk -class storage
*-sas
description: Serial Attached SCSI controller
product: SAS2308 PCI-Express Fusion-MPT SAS-2
vendor: LSI Logic / Symbios Logic
physical id: 0
bus info: pci@0000:05:00.0
logical name: scsi0
version: 05
width: 64 bits
clock: 33MHz
capabilities: sas pm pciexpress vpd msi msix bus_master cap_list
configuration: driver=mpt2sas latency=0
resources: irq:28 ioport:1000(size=256) memory:b1940000-b194ffff memory:b1900000-b193ffff
*-disk:0
description: SCSI Disk
product: HUS156060VLS600
vendor: HITACHI
physical id: 0.0.0
bus info: scsi@0:0.0.0
logical name: /dev/sda
version: A5D0
serial: LXYPEN4N
size: 558GiB (600GB)
capacity: 690GiB (741GB)
capabilities: 15000rpm partitioned partitioned:dos
configuration: ansiversion=6 logicalsectorsize=512 sectorsize=512 signature=000c7267
*-disk:1
description: ATA Disk
product: HGST HUS724030AL
physical id: 0.1.0
bus info: scsi@0:0.1.0
logical name: /dev/sdb
version: AA70
serial: PN1234P9GBA12T
size: 2794GiB (3TB)
capacity: 2794GiB (3TB)
capabilities: 15000rpm gpt-1.00 partitioned partitioned:gpt
configuration: ansiversion=6 guid=848982cf-d9f0-45fa-86a6-e238c1b21ee5 logicalsectorsize=512 sectorsize=512
*-disk:2
description: ATA Disk
product: HGST HUS724030AL
physical id: 0.2.0
bus info: scsi@0:0.2.0
logical name: /dev/sdc
version: AA70
serial: PN1234P9GBA4YT
size: 2794GiB (3TB)
capacity: 2794GiB (3TB)
capabilities: 15000rpm gpt-1.00 partitioned partitioned:gpt
configuration: ansiversion=6 guid=8b8b48bb-beff-4dd4-8f5d-7a224ce39441 logicalsectorsize=512 sectorsize=512
*-disk:3
description: ATA Disk
product: INTEL SSDSC2BB24
physical id: 0.3.0
bus info: scsi@0:0.3.0
logical name: /dev/sdd
version: 0130
serial: BTWA540205SH240AGN
size: 223GiB (240GB)
capacity: 223GiB (240GB)
capabilities: 15000rpm gpt-1.00 partitioned partitioned:gpt
configuration: ansiversion=6 guid=37f0feb3-d50a-49de-90bd-7b33bcffca7e logicalsectorsize=512 sectorsize=4096
*-raid
description: RAID bus controller
product: 82801JIR (ICH10R) SATA RAID Controller
vendor: Intel Corporation
physical id: 1f.2
bus info: pci@0000:00:1f.2
logical name: scsi5
version: 00
width: 32 bits
clock: 66MHz
capabilities: raid msi pm bus_master cap_list emulated
configuration: driver=ahci latency=0
resources: irq:49 ioport:3108(size=8) ioport:3114(size=4) ioport:3100(size=8) ioport:3110(size=4) ioport:3020(size=32) memory:b1b20000-b1b207ff
*-cdrom
description: DVD-RAM writer
product: DVD RW AD-7710H
vendor: Optiarc
physical id: 0.0.0
bus info: scsi@5:0.0.0
logical name: /dev/cdrom
logical name: /dev/sr0
version: 1.01
capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
configuration: ansiversion=5 status=nodisc

Для отображения краткого списка дисков в системе, достаточно выполнить команду lshw -short -C disk

1
2
3
4
5
6
7
8
# lshw -short -C disk
H/W path Device Class Description
=============================================================
/0/100/7/0/0.0.0 /dev/sda disk 741GB HUS156060VLS600
/0/100/7/0/0.1.0 /dev/sdb disk 3TB HGST HUS724030AL
/0/100/7/0/0.2.0 /dev/sdc disk 3TB HGST HUS724030AL
/0/100/7/0/0.3.0 /dev/sdd disk 240GB INTEL SSDSC2BB24
/0/100/1f.2/0.0.0 /dev/cdrom disk DVD RW AD-7710H

Утилита LSHW

Аналогично с предыдущей командой извлекает огромное количество разнообразной информации о дисках. Запускается с ключом -I, указав путь диска, к примеру hdparm -I /dev/sdd:

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
# hdparm -I /dev/sdd

/dev/sdd:

ATA device, with non-removable media
Model Number: INTEL SSDSC2BB240G6
Serial Number: BTWA540205SH240AGN
Firmware Revision: G2010130
Media Serial Num:
Media Manufacturer:
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6
Standards:
Used: unknown (minor revision code 0x0110)
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: 4096 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 = 1 Current = 1
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
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
* IDLE_IMMEDIATE with UNLOAD
* WRITE_UNCORRECTABLE_EXT command
* {READ,WRITE}_DMA_EXT_GPL commands
* Segmented DOWNLOAD_MICROCODE
unknown 119[6]
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Gen3 signaling speed (6.0Gb/s)
* Native Command Queueing (NCQ)
* Phy event counters
* unknown 76[15]
* Software settings preservation
* SMART Command Transport (SCT) feature set
* SCT Write Same (AC2)
* SCT Error Recovery Control (AC3)
* SCT Features Control (AC4)
* SCT Data Tables (AC5)
* reserved 69[4]
* Data Set Management TRIM supported (limit 4 blocks)
* Deterministic read ZEROs after TRIM
Security:
Master password revision code = 65534
supported
not enabled
not locked
not frozen
not expired: security count
supported: enhanced erase
4min for SECURITY ERASE UNIT. 4min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 55cd2e404c0fe0fa
NAA : 5
IEEE OUI : 5cd2e4
Unique ID : 04c0fe0fa
Checksum: correct