SSD wear and IORegistry

Having invested, sometimes heavily, in SSDs, what we all want to know is how quickly they’re likely to wear out. Five years ago, with the help of the free smartmontools, I produced a little tool which could provide a rough estimate of current SSD ‘wear’, and either reassure or raise the alarm. Recently several of you have contacted me asking whether it can be brought up to date, presumably because you too are concerned at how the SSD inside your new M1 Mac is ageing.

The rule of thumb is based on the assumption that SSDs should be good for at least 5,000 erase-write cycles. If you think that the expensive SSD in your M1 Mac should do better, then by all means use a figure of 10,000 if you prefer.

The internal SSD in this iMac Pro has a capacity of 1 TB, so if it’s good for those 5,000 cycles, it shouldn’t die until a total of 5,000 TB have been written to it. SMART indicator 175 Host_Writes_MiB (or its equivalent) should tell you the total written to it since new. In my case, that’s just over 100 TB, suggesting that my iMac Pro’s SSD shouldn’t fail until another 4,900 TB has been written to it. As it’s over three years old, at its present rate of use that should be in well over 100 years.

So how can you read SMART indicator 175 for your internal SSD, and any external disks? That’s the difficult part.

Sadly, smartmontools seems to have become rather neglected since I wrote my original article. Not only that, but to read SMART indicators on USB external disks, you need to install a kernel extension, which isn’t a good way to go with an M1 Mac. You can download smartmontools through this page, but you’ll notice that the last released version was at the end of 2020. That’s available as a disk image from here, but as its installer package isn’t signed, Monterey doesn’t like it at all.

Surely macOS contains SMART information about its own internal SSDs? Well, look in Disk Utility, and all you’ll see is SMART status: Verified, and I have absolutely no idea what that might mean. System Information repeats the same words, and doesn’t reveal how much data has been written to any disk.

ssdwear1

But there’s something interesting about Disk Utility’s media information window, shown when you select a disk and click on the Info tool.

ssdwear2

On the fourth line down, there’s a Device tree path. That tells you where you can find full details about the disk in the IORegistry.

IORegistry is the dictionary of dictionaries which contains almost everything your Mac knows about its I/O devices. The problem is that it’s vast and sprawling, and so easy to get lost in. Some of my apps like Mints check information in IORegistry, and I’ve wasted days wandering around in it, like Mervyn Peake’s Gormenghast castle.

I was doing that in Swift, which is somewhat eyewatering, but now there’s a free app which can browse the whole of IORegistry, called appropriately IOBrowser, from XS-labs. Sure enough, armed with the device tree path you can study the information saved in IORegistry about each of the disks attached to your Mac. But there’s nothing about totals written to an SSD, or even a mention of SMART indicators.

ssdwear3

So I’m left to fall back on the app which I’ve relied on over those years to monitor the use and health of my SSDs: DriveDx. Sadly it’s still Intel only, but apparently runs fine in Rosetta. It’s also reliant on that kernel extension if you want to examine USB disks, even on an M1 Mac, which means reducing its security and explicitly allowing it to load third-party kernel extensions. For our M1 Macs, we really need this rewritten as a system extension, or even better incorporated into macOS. It would be so helpful if Apple were to finally get round to providing full support for USB storage 24 years after it first supported USB devices.

ssdwear4

There are other tools of course, but still none as good as DriveDx. I just hope Binary Fruit will make it more usable on M1 Macs, where we’re all most interested in learning how their internal SSDs are coping.