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

I get the following on my Mac Mini with a 512 GB drive:

smartctl -a disk0
smartctl 7.3 2022-02-28 r5338 [Darwin 22.5.0 x86_64] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       APPLE SSD AP0512M
Serial Number:                      C078504002HJRFYAB
Firmware Version:                   1296.120
PCI Vendor/Subsystem ID:            0x106b
IEEE OUI Identifier:                0x000000
Controller ID:                      0
NVMe Version:                       <1.2
Number of Namespaces:               1
Local Time is:                      Sun Jul  9 20:22:36 2023 ADT
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:                        49 Celsius
Available Spare:                    100%
Available Spare Threshold:          99%
Percentage Used:                    11%
Data Units Read:                    355,382,704 [181 TB]
Data Units Written:                 237,678,387 [121 TB]
Host Read Commands:                 7,371,234,957
Host Write Commands:                3,890,298,980
Controller Busy Time:               0
Power Cycles:                       449
Power On Hours:                     4,191
Unsafe Shutdowns:                   277
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

bash-3.2$ 

I’m trying to figure out if I need a new Mac. I keep getting the following error when I run First Aid. I can repair it but then it returns:

/dev/rdisk1s1: ** Checking snapshot 11 of 12 (com.apple.TimeMachine.2023-07-08-182610.local)
/dev/rdisk1s1: warning: mismatch between extentref entry reference count (0) and calculated fsroot entry reference count (-1) for extent (75965840 + 4)
/dev/rdisk1s1: warning: mismatch between extentref entry reference count (0) and calculated fsroot entry reference count (-1) for extent (76696330 + 8)
/dev/rdisk1s1: ** Checking snapshot 12 of 12 (com.apple.TimeMachine.2023-07-08-192548.local)
/dev/rdisk1s1: error: mismatch between extentref entry reference count (0) and calculated fsroot entry reference count (1) for extent (75965840 + 4)
/dev/rdisk1s1: error: mismatch between extentref entry reference count (0) and calculated fsroot entry reference count (1) for extent (76696330 + 8)
/dev/rdisk1s1: ** Checking the document ID tree.
/dev/rdisk1s1: ** Checking the fsroot tree.
/dev/rdisk1s1: ** Checking the extent ref tree.
/dev/rdisk1s1: ** Verifying volume object map space.
/dev/rdisk1s1: ** The volume /dev/rdisk1s1 was found to be corrupt and needs to be repaired.
/dev/rdisk1s1: ** Verifying allocated space.
/dev/rdisk1s1: ** Performing deferred repairs.
/dev/rdisk1s1: error: Unable to perform deferred repairs without full space verification
/dev/rdisk1s1: error: Try running fsck against the entire APFS container instead of a volume
/dev/rdisk1s1: ** The volume /dev/rdisk1s1 could not be verified completely.
/dev/rdisk1s1: Sat Jul  8 20:09:48 2023

I’m getting this on an M1 mac mini with a 1TB SSD

josh@joshuas-mini ~ % smartctl -a disk3s5
smartctl 7.3 2022-02-28 r5338 [Darwin 22.5.0 arm64] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       APPLE SSD AP1024Q
Serial Number:                      0ba0122c40a52e0b
Firmware Version:                   874.120.
PCI Vendor/Subsystem ID:            0x106b
IEEE OUI Identifier:                0x000000
Controller ID:                      0
NVMe Version:                       <1.2
Number of Namespaces:               3
Local Time is:                      Wed Jul 26 08:06:52 2023 CDT
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:                        33 Celsius
Available Spare:                    100%
Available Spare Threshold:          99%
Percentage Used:                    10%
Data Units Read:                    653,815,670 [334 TB]
Data Units Written:                 495,164,729 [253 TB]
Host Read Commands:                 12,687,340,931
Host Write Commands:                6,148,184,985
Controller Busy Time:               0
Power Cycles:                       225
Power On Hours:                     5,760
Unsafe Shutdowns:                   79
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

Also, there’s a free GUI-based SSD monitor called SSDReporter. Link: Mac SSDReporter - check & monitor your SSD / Flash Storage health