What is the best way to get the correct value of total bytes written to disk per day?
My goal is to log it over time, so as an admin you can gain some sense of activity on a Linux Server and have a metric first hand that I can use to somewhat predict an SSD life expectancy... if cheaper consumer grade 1-DWPD can be used or for what you are doing you need to be using 3-DWPD enterprise class ssd's for example.
I am interested in the difference between XFS, EXT4, BTFS file system choices, as well as extra software/services installed in Linux, that might have an effect on SSD life.
is there a better command than smartctl
to capture the information I am looking for? I can write code to deal with this --xall
extended output, or it there a better more specific smartctl option?
based on this output, what would value should I use to determine drive writes accurately? I would do the following for disks 0..7 via -d megaraid,#
. This on on 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
smartctl -a /dev/nvme0n1 | grep "Data Units Written"
@BarryCarter maybe I do. I can neither confirm nor deny it.grep -i "Data Units"
is blankAccumulated power on time
of 1170 hours, or 48 days, is not correct, this server with this disk is on 24/7 for the past 2+ years; it would be more believable if 1170 represented days not hours.