如何在 Linux 中生成写入磁盘 (SSD) 的总字节数 (TBW,DWPD) 的每日报告

如何在 Linux 中生成写入磁盘 (SSD) 的总字节数 (TBW,DWPD) 的每日报告

获得正确值的最佳方法是什么写入的总字节数每天到磁盘?

我的目标是随着时间的推移记录下来,这样作为管理员,您可以对 Linux 服务器上的活动有一定的了解,并掌握第一手指标,我可以用它来预测 SSD 的预期寿命……如果更便宜的消费级 1-例如,可以使用 DWPD,或者对于您正在做的事情,您需要使用 3-DWPD 企业级 SSD。

我对 XFS、EXT4、BTFS 文件系统选择之间的差异以及 Linux 中安装的额外软件/服务感兴趣,这些差异可能会影响 SSD 的寿命。

smartctl有没有比捕获我正在寻找的信息更好的命令? 我可以编写代码来处理这个--xall扩展输出,或者有更好的更具体的 smartctl 选项吗?

根据此输出,我应该使用什么值来准确确定驱动器写入?我将通过 为磁盘 0..7 执行以下操作-d megaraid,#。这在 RHEL 8.9 上有效。

smartctl --xall -d megaraid,0 /dev/sda

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-4.18.0-513.11.1.el8_9.x86_64] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               TOSHIBA
Product:              KPM5WRUG3T84
Revision:             B318
Compliance:           SPC-4
User Capacity:        3,840,755,982,336 bytes [3.84 TB]
Logical block size:   512 bytes
Physical block size:  4096 bytes
LU is resource provisioned, LBPRZ=1
Rotation Rate:        Solid State Device
Form Factor:          2.5 inches
Logical Unit id:      0x58ce38ee20abca55
Serial number:        abc123
Device type:          disk
Transport protocol:   SAS (SPL-3)
Local Time is:        Thu Mar  7 13:55:22 2024 EST
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Disabled or Not Supported
Read Cache is:        Enabled
Writeback Cache is:   Enabled

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK

Percentage used endurance indicator: 0%
Current Drive Temperature:     29 C
Drive Trip Temperature:        70 C

Manufactured in week 33 of year 2019
Elements in grown defect list: 2

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      27081.068           0
write:         0        0         0         0          0       8041.818           0
verify:        0        0         0         0          0      23058.613           0

Non-medium error count:       87

SMART Self-test log
Num  Test              Status                 segment  LifeTime  LBA_first_err [SK ASC ASQ]
     Description                              number   (hours)
# 1  Background long   Completed                   -      38                 - [-   -    -]
# 2  Background short  Completed                   -      37                 - [-   -    -]
# 3  Background long   Completed                   -      14                 - [-   -    -]
# 4  Background short  Completed                   -      14                 - [-   -    -]

Long (extended) Self-test duration: 300 seconds [5.0 minutes]

Background scan results log
  Status: no scans active
    Accumulated power on time, hours:minutes 1169:17 [70157 minutes]
    Number of background scans performed: 0,  scan progress: 0.00%
    Number of background medium scans performed: 0

Protocol Specific port log page for SAS SSP
relative target port id = 1
  generation code = 4
  number of phys = 1
  phy identifier = 0
    attached device type: SAS or SATA device
    attached reason: unknown
    reason: loss of dword synchronization
    negotiated logical link rate: phy enabled; 12 Gbps
    attached initiator port: ssp=1 stp=1 smp=1
    attached target port: ssp=0 stp=0 smp=0
    SAS address = 0x58ce38ee20abca56
    attached SAS address = 0x52cea7f048bd6b07
    attached phy identifier = 1
    Invalid DWORD count = 12
    Running disparity error count = 12
    Loss of DWORD synchronization = 3
    Phy reset problem = 0
relative target port id = 2
  generation code = 4
  number of phys = 1
  phy identifier = 1
    attached device type: no device attached
    attached reason: unknown
    reason: unknown
    negotiated logical link rate: phy enabled; unknown
    attached initiator port: ssp=0 stp=0 smp=0
    attached target port: ssp=0 stp=0 smp=0
    SAS address = 0x58ce38ee20abca57
    attached SAS address = 0x0
    attached phy identifier = 0
    Invalid DWORD count = 0
    Running disparity error count = 0
    Loss of DWORD synchronization = 0
    Phy reset problem = 0

相关内容