Checking the health of your Mac's drive(s)

Continuing the discussion from Microsoft committed to Right to Repair, will Apple follow suit?:

Thought this might be of interest, from a Stack Exchange post:

You can install smartmon tools using homebrew:
brew install smartmontools

Use diskutil to get the device name of the drive you’re interested in:

(base) john@Johns-MBP ~ % diskutil list
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         1.0 TB     disk0
   1:             Apple_APFS_ISC                         524.3 MB   disk0s1
   2:                 Apple_APFS Container disk3         994.7 GB   disk0s2
   3:        Apple_APFS_Recovery                         5.4 GB     disk0s3

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +994.7 GB   disk3
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            15.3 GB    disk3s1
   2:              APFS Snapshot com.apple.os.update-... 15.3 GB    disk3s1s1
   3:                APFS Volume Preboot                 544.3 MB   disk3s2
   4:                APFS Volume Recovery                1.0 GB     disk3s3
   5:                APFS Volume Data                    657.3 GB   disk3s5
   6:                APFS Volume VM                      4.3 GB     disk3s6

/dev/disk4 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +88.6 MB    disk4
   1:                  Apple_HFS Duplicacy Web Edition   88.6 MB    disk4s1

Then run smartctl to get detailed SMART drive stats:
(this area is long, and scrolls)

(base) john@Johns-MBP ~ % smartctl -a disk0
smartctl 7.2 2020-12-30 r5155 [Darwin 20.6.0 arm64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       APPLE SSD AP1024Q
Serial Number:                      0ba0122b83353e18
Firmware Version:                   2.120.4
PCI Vendor/Subsystem ID:            0x106b
IEEE OUI Identifier:                0x000000
Controller ID:                      0
NVMe Version:                       <1.2
Number of Namespaces:               3
Local Time is:                      Sat Oct  9 12:35:39 2021 EDT
Firmware Updates (0x02):            1 Slot
Optional Admin Commands (0x0004):   Frmw_DL
Optional NVM Commands (0x0004):     DS_Mngmt
Maximum Data Transfer Size:         256 Pages

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     0.00W       -        -    0  0  0  0        0       0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        36 Celsius
Available Spare:                    100%
Available Spare Threshold:          99%
Percentage Used:                    1%
Data Units Read:                    96,469,301 [49.3 TB]
Data Units Written:                 68,796,232 [35.2 TB]
Host Read Commands:                 1,012,666,993
Host Write Commands:                406,748,108
Controller Busy Time:               0
Power Cycles:                       120
Power On Hours:                     515
Unsafe Shutdowns:                   20
Media and Data Integrity Errors:    0
Error Information Log Entries:      0

Read 1 entries from Error Information Log failed: GetLogPage failed: system=0x38, sub=0x0, code=745

I’ve had my M1 MBP since January 2020 (I think), and used it lightly.
The interesting bits are:

Critical Warning: 0x00 That’s always a good thing.

Available Spare: 100% Also good, none of the spare blocks have been used.
Percentage Used: 1% Although this is interesting.

Data Units Written: 68,796,232 [35.2 TB] Life span varies, and could be 600TiB written (or more), so extrapolating: (600 / 35) * 9 months = 154 months. Not something you’d make a wager on though.

Unsafe Shutdowns: 20 Probably the number of kernel panics I’ve had.

So all in all, no errors and no need to start using the spare blocks.

2 Likes

For comparison, my 2017 iMac Pro that I bought in January 2018 (I think):

(base) Johns-iMac-Pro :: ~ » smartctl -a disk1
smartctl 7.2 2020-12-30 r5155 [Darwin 20.6.0 x86_64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       APPLE SSD AP1024M
Serial Number:                      C0274820127J803AW
Firmware Version:                   1161.100
PCI Vendor/Subsystem ID:            0x106b
IEEE OUI Identifier:                0x000000
Controller ID:                      0
NVMe Version:                       <1.2
Number of Namespaces:               1
Local Time is:                      Sat Oct  9 12:57:44 2021 EDT
Firmware Updates (0x02):            1 Slot
Optional Admin Commands (0x0004):   Frmw_DL
Optional NVM Commands (0x0004):     DS_Mngmt
Maximum Data Transfer Size:         256 Pages

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     0.00W       -        -    0  0  0  0        0       0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        48 Celsius
Available Spare:                    100%
Available Spare Threshold:          99%
Percentage Used:                    11%
Data Units Read:                    6,056,588,255 [3.10 PB]
Data Units Written:                 690,724,631 [353 TB]
Host Read Commands:                 67,862,215,970
Host Write Commands:                6,478,352,484
Controller Busy Time:               0
Power Cycles:                       258
Power On Hours:                     9,482
Unsafe Shutdowns:                   92
Media and Data Integrity Errors:    0
Error Information Log Entries:      0

Read 1 entries from Error Information Log failed: GetLogPage failed: system=0x38, sub=0x0, code=745

So the anomaly again:

Available Spare:                    100%
Available Spare Threshold:          99%
Percentage Used:                    11%

I would think Percentage Used would be the more accurate number, rather than Available Spare. Or maybe I don’t understand something.

Data Units Read:                    6,056,588,255 [3.10 PB]
Data Units Written:                 690,724,631 [353 TB]

353 TiB written, so theoretically half the drive’s life, although only 11% of spares used. Of course spare use may be exponential as the drive ages.

Just for comparison, my 2018 Mini that I purchased in November of 2019. This is my daily work machine:

SMART/Health Information (NVMe Log 0x02)
Critical Warning: 0x00
Temperature: 55 Celsius
Available Spare: 100%
Available Spare Threshold: 99%
Percentage Used: 2%
Data Units Read: 552,920,627 [283 TB]
Data Units Written: 75,448,732 [38.6 TB]
Host Read Commands: 18,031,687,147
Host Write Commands: 1,348,056,623
Controller Busy Time: 0
Power Cycles: 330
Power On Hours: 2,496
Unsafe Shutdowns: 225
Media and Data Integrity Errors: 0
Error Information Log Entries: 0

1 Like

Cool!
Thanks for demonstrating ```text I didn’t know that was a thing!

1 Like

Just want to plug my favorite app for monitoring hard drive health if you aren’t into CLI stuff. This is one of those “should be more popular” apps.

https://binaryfruit.com/drivedx

1 Like