Monitoring SSD wear and ageing

A few days ago, I drew attention to potential problems in Macs with solid-state drives (SSDs) as they grow older, and the drives wear out. Unlike hard drives, they cannot suffer mechanical failure, or problems with the magnetic material on a hard drive’s platters. However, SSDs can only write data a certain number of times, and in any case cease functioning after around 10 years. The more that you use your SSD, the earlier it will fail.

Some predictions for the typical life of an SSD in a computer are very optimistic, perhaps more than ten years. In practice, though, this is very dependent on software (or firmware) evening out the number of writes across the SSD – so-called wear levelling. What we don’t know is how effective that is in each case.

A unique user?

I have come across one user, with an iMac which has an Apple Fusion Drive with only three months of continuous use on the clock, whose SSD is now almost worn out.

There are several possible explanations for this. Maybe his iMac has been running Apple’s iCloud services for Europe, or the S.M.A.R.T. monitoring on it is giving absurdly incorrect figures. Most likely, though, is that the wear levelling software has not always been working properly.

His iMac could be unique in this, but I suspect that there are others, perhaps many. Apple has been fitting pure SSDs in MacBook Airs since January 2008, and in MacBook Pro models since late 2008. iMacs have been offered with Fusion Drives from late 2012 onwards. That is an awful lot of Macs with SSDs, so even a small proportion of them with similar problems could mean that many users are facing expensive repairs.

Finding out

myssddrivedx

If your Mac has an SSD, it is not easy to discover how worn out that is. Some specialist S.M.A.R.T. tools such as DriveDx can do so, but Disk Utility and other common tools will only warn you when the drive fails a test. That could give you no real warning.

There are two useful measures of the expected lifespan of an SSD: all SSDs should monitor S.M.A.R.T. indicator number 173, Wear_Leveling_Count, which is a direct measurement of this. Alternatively, you can get a rough estimate by assuming that wear is reasonably levelled across the storage blocks, and using the total amount of data written to the SSD and its capacity to calculate how much of the likely ‘wear’ has been used up. I gave example calculations in my previous article.

Unfortunately, S.M.A.R.T. indicator 173 and the total data written are not given in any of the standard utilities bundled with Macs, nor as far as I can see in any of Apple’s bundled diagnostics, even those run from the command line. So until now, if you have not been prepared to pay for DriveDx, you are most unlikely to know how rapidly your SSD is ageing – until it suddenly fails.

Free solutions

I now offer two free solutions for those who prefer not to pay for DriveDx: an open-source command shell tool for those who like to tango in Terminal, and a simple little AppleScript app for those who don’t.

Either way, you will need to download and install the superb smartmontools from here. This comes as a disk image. Open that to mount the disk image, and you will see an installer package. Because this is not signed, you must use the Finder’s popup menu to Open it, and will there be required to authenticate as an admin user. This will allow Installer to place the tools and their supporting files in their correct locations.

Once smartmontools is installed, you can then run my little AppleScript app downloaded from here: HowsMySSD
Again, because it is not signed, the first time that you run it you will need to do so via the Finder’s Open command and authenticate.

howsmyssdp

What the script does is to check each of the drives mounted on your Mac at that moment to see if it is an SSD. If it is, then it should display the information shown. Enclosed with the app is a script-only version, to make it easier to modify your copy as you wish. This is a quick and dirty script without a fancy interface, but should work for you. If it does not, please let me know, preferably by email.

One oddity of OS X is that many SSDs, particularly those in Fusion Drives, will be reported twice, under two different drive numbers. That is quite normal and nothing to worry about.

If your results are worrying or alarming, I would be very interested to see them: you can copy and paste them either into an email to me, or as a comment below.

Terminal wizards

For those who would prefer to run the Terminal command themselves, it takes the form
/usr/local/sbin/smartctl -A /dev/disk0
where you should substitute disk1, disk2, etc., for respective drives, as necessary.

This generates a long report on that drive. If it is an SSD, it should be detailed as such, and provide indicator number 173. The WORST value for that, less 100, gives the wear levelling value as a percentage. This normally drops quickly from 100% (brand new) to 90-95%, then drops much more gradually. If it is getting close to 50%, you should start to be concerned, and once it falls below 50% your SSD is starting to wear out badly.

The other, and more approximate, measure is to take the drive capacity report, e.g. 121 GB, and multiply that by 5000 for the approximate number of write operations which will take place before write failure becomes likely. The easy way to do that is to turn the number into TB and multiply by 5, so my 121 GB drive has a total write capacity of around 600 TB.

Compare that with the figure from indicator 175 Host_Writes_MiB, which you should divide by one million to arrive at the value in TB. Currently my figure shown in smartctl is 6333234, which becomes 6.3 TB. So my iMac has currently used about 1% of its expected total writes over the six months it has been in use. Assuming a similar write rate, its SSD should therefore be good for a total of around 100 x 6 months = 50 years.

I hope that these are helpful, and that they confirm that your SSD is wearing well.