背景
公司采购的服务器已经做好阵列,但其中几块盘不需要做阵列,供应商提供过来的时候已经格式化,很巧的是,磁盘大小都一致。无法通过简单方式查看阵列。机房很冷,且服务器已经安装了一些服务,尽量不重启。
解决思路
- 使用
df -h
查看磁盘空间情况。
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 63G 0 63G 0% /dev
tmpfs 63G 0 63G 0% /dev/shm
tmpfs 63G 4.1G 59G 7% /run
tmpfs 63G 0 63G 0% /sys/fs/cgroup
/dev/mapper/cl-root 50G 42G 8.8G 83% /
/dev/sdc2 976M 128M 782M 15% /boot
/dev/sdb1 7.3T 93M 6.9T 1% /data1
/dev/sdc1 599M 6.7M 593M 2% /boot/efi
/dev/sda1 7.3T 45G 6.9T 1% /data
/dev/mapper/cl-home 7.3T 1.4T 5.9T 20% /home
- 使用
fdisk -l
查看磁盘分区情况。
Disk /dev/sdc:7.3 TiB,8000987201536 字节,15626928128 个扇区
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
磁盘标签类型:gpt
磁盘标识符:72FB02AB-76F6-4611-8F2E-A6B25F37A0E9
设备 起点 末尾 扇区 大小 类型
/dev/sdc1 2048 1230847 1228800 600M EFI 系统
/dev/sdc2 1230848 3327999 2097152 1G Linux 文件系统
/dev/sdc3 3328000 15626926079 15623598080 7.3T Linux LVM
Disk /dev/sdb:7.3 TiB,8001563222016 字节,15628053168 个扇区
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
磁盘标签类型:gpt
磁盘标识符:8432303B-8459-4FA3-8E75-B8E1656D5A08
设备 起点 末尾 扇区 大小 类型
/dev/sdb1 2048 15628052479 15628050432 7.3T Linux 文件系统
Disk /dev/sda:7.3 TiB,8001563222016 字节,15628053168 个扇区
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
磁盘标签类型:gpt
磁盘标识符:9E6D931C-86C4-487F-B27A-F9FF0B761FC5
设备 起点 末尾 扇区 大小 类型
/dev/sda1 2048 15628052479 15628050432 7.3T Linux 文件系统
Disk /dev/mapper/cl-root:50 GiB,53687091200 字节,104857600 个扇区
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
Disk /dev/mapper/cl-swap:4 GiB,4294967296 字节,8388608 个扇区
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
Disk /dev/mapper/cl-home:7.2 TiB,7941298061312 字节,15510347776 个扇区
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
- 使用
smartctl --all /dev/sdx
查看每个磁盘的物理情况
`smartctl --all /dev/sda`
smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.18.0-80.el8.x86_64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: SEAGATE
Product: ST8000NM014A
Revision: CSL7
Compliance: SPC-5
User Capacity: 8,001,563,222,016 bytes [8.00 TB]
Logical block size: 512 bytes
Physical block size: 4096 bytes
Formatted with type 2 protection
LU is fully provisioned
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Logical Unit id: 0x5000c500c9f71fa7
Serial number: xxxxxx
Device type: disk
Transport protocol: SAS (SPL-3)
Local Time is: Fri Oct 15 15:24:17 2021 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Temperature Warning: Disabled or Not Supported
=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Current Drive Temperature: 35 C
Drive Trip Temperature: 60 C
Manufactured in week 12 of year 2020
Specified cycle count over device lifetime: 50000
Accumulated start-stop cycles: 115
Specified load-unload count over device lifetime: 600000
Accumulated load-unload cycles: 219
Elements in grown defect list: 0
Vendor (Seagate) cache information
Blocks sent to initiator = 3902599712
Blocks received from initiator = 3843953960
Blocks read from cache and sent to initiator = 236941668
Number of read and write commands whose size <= segment size = 131631170
Number of read and write commands whose size > segment size = 187346
Vendor (Seagate/Hitachi) factory information
number of hours powered up = 2708.57
number of minutes until next internal SMART test = 8
Error counter log:
Errors Corrected by Total Correction Gigabytes Total
ECC rereads/ errors algorithm processed uncorrected
fast | delayed rewrites corrected invocations [10^9 bytes] errors
read: 0 12 0 12 12 48911.591 0
write: 0 0 0 0 0 13169.216 0
verify: 0 0 0 0 0 18.804 0
Non-medium error count: 0
No self-tests have been logged
[root@localhost Linux]# smartctl --all /dev/sdb
smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.18.0-80.el8.x86_64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: SEAGATE
Product: ST8000NM014A
Revision: CSL7
Compliance: SPC-5
User Capacity: 8,001,563,222,016 bytes [8.00 TB]
Logical block size: 512 bytes
Physical block size: 4096 bytes
Formatted with type 2 protection
LU is fully provisioned
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Logical Unit id: 0x5000c500c9f781b7
Serial number: xxxxx
Device type: disk
Transport protocol: SAS (SPL-3)
Local Time is: Fri Oct 15 15:25:30 2021 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Temperature Warning: Disabled or Not Supported
=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Current Drive Temperature: 34 C
Drive Trip Temperature: 60 C
Manufactured in week 12 of year 2020
Specified cycle count over device lifetime: 50000
Accumulated start-stop cycles: 111
Specified load-unload count over device lifetime: 600000
Accumulated load-unload cycles: 216
Elements in grown defect list: 0
Vendor (Seagate) cache information
Blocks sent to initiator = 1175989216
Blocks received from initiator = 124568736
Blocks read from cache and sent to initiator = 584880126
Number of read and write commands whose size <= segment size = 130963104
Number of read and write commands whose size > segment size = 204078
Vendor (Seagate/Hitachi) factory information
number of hours powered up = 2708.53
number of minutes until next internal SMART test = 48
Error counter log:
Errors Corrected by Total Correction Gigabytes Total
ECC rereads/ errors algorithm processed uncorrected
fast | delayed rewrites corrected invocations [10^9 bytes] errors
read: 0 5 0 5 5 51960.791 0
write: 0 0 0 0 0 13468.537 0
verify: 0 0 0 0 0 18.532 0
Non-medium error count: 0
No self-tests have been logged
[root@localhost Linux]# smartctl -a -d megaraid,0 /dev/sdc
smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.18.0-80.el8.x86_64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: SEAGATE
Product: ST8000NM014A
Revision: CSL7
Compliance: SPC-5
User Capacity: 8,001,563,222,016 bytes [8.00 TB]
Logical block size: 512 bytes
Physical block size: 4096 bytes
Formatted with type 2 protection
LU is fully provisioned
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Logical Unit id: 0x5000c500c9f6f64b
Serial number: xxxx2
Device type: disk
Transport protocol: SAS (SPL-3)
Local Time is: Fri Oct 15 17:43:11 2021 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Temperature Warning: Disabled or Not Supported
=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Current Drive Temperature: 32 C
Drive Trip Temperature: 60 C
Manufactured in week 12 of year 2020
Specified cycle count over device lifetime: 50000
Accumulated start-stop cycles: 116
Specified load-unload count over device lifetime: 600000
Accumulated load-unload cycles: 218
Elements in grown defect list: 0
Vendor (Seagate) cache information
Blocks sent to initiator = 2647941272
Blocks received from initiator = 2167839016
Blocks read from cache and sent to initiator = 81230511
Number of read and write commands whose size <= segment size = 4254847
Number of read and write commands whose size > segment size = 55632
Vendor (Seagate/Hitachi) factory information
number of hours powered up = 2710.90
number of minutes until next internal SMART test = 4
Error counter log:
Errors Corrected by Total Correction Gigabytes Total
ECC rereads/ errors algorithm processed uncorrected
fast | delayed rewrites corrected invocations [10^9 bytes] errors
read: 0 0 0 0 0 10083.345 0
write: 0 0 0 0 0 3364.136 0
verify: 0 0 0 0 0 89562.436 0
Non-medium error count: 0
No self-tests have been logged