If you have a newer Mac, it probably uses a fast SSD drive to store files, apps, music, videos, and a lot of other important stuff. But there is one thing you may not know about SSDs: they wear out over time.
Since the SSD is such a vital part of your Mac, it’s a good idea to keep an eye on its health. While it usually takes a very long time for an SSD to wear out – probably much longer than you keep your Mac – issues can arise. Most recently, users began to notice that new M1 Macs and some Intel-based Macs show advanced wear and tear after just a few months of use, a disturbing sign that drives could burn out years earlier.
So even if you have a brand new M1
In this article, you will learn how to set up the Terminal so that you can install and run smart montools. However, make some time. While the procedure isn’t difficult (if I can, I certainly can), since you’re dealing with command line input, you need to pay a bit more attention to what you’re doing than with apps you usually use on the Mac. There are so many times when I could have saved myself some frustration if I was just more careful typing.
These instructions were created with macOS Big Sur, but can also be used in macOS Catalina. If something goes wrong, don’t panic. The worst scenario is that you will have to reinstall macOS in recovery mode, which will take some time but will leave all your files intact.
How to install Xcode
The first thing you need to do is install Xcode, an Apple app for developers. It has a set of command line tools that your Mac needs before you can install and run Homebrew, which is a prerequisite for running smartmontools. You can get Xcode from the App Store for free.
After you download Xcode, go to the Utilities folder to open it. You must agree to the software license before you can proceed, type in your Mac password and terms and conditions. Then you can close the app.
How to install Homebrew
Now you need to install a package manager, which is a set of utilities needed to perform tasks such as installations and uninstallations. There are several package managers available, and Homebrew is a popular one, so we’ll be using it here.
1. Open Terminal (Applications> Ultilities)
2. Copy the line below (click it three times to select all) and paste it into the terminal and hit return.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. You will be asked to enter your Mac login password to grant
'sudo' access, which allows you to run programs with security rights. Terminal doesn’t show a visual indication that you’re entering your password (no bullets, asterisks, or the like), so type it in carefully and hit the Return key.
Terminal responds by telling you what is being installed. Press Return to continue, or any other key if you decide to stop the installation.
3. Terminal will display status updates on the installation, which will take a few minutes, but you won’t see any spinning icons, a progress bar, or anything like that. It can sit
Installing with Command Line Tools for Xcode for a while, but it works (really).
Ultimately, Terminal will display a lot of things in quick succession. You should see
Downloading and installing Homebrew, followed by
Updated Formulae, and
Deleted FormulaeThen below that you should see
Installation successful! followed by some useful reference information.
4. At the end of the installation, there should be a Terminal prompt, and a few lines above the prompt you can see it in bold
Next stepsYou may need to add Homebrew to your
PATH tells the terminal where executables can be found.
Since I am using macOS Big Sur, the Terminal uses ZSH as the default shell, the user interface used to run commands. The command to it
PATH file is as follows:
Copy and paste that into the Terminal and hit return.
5. A new window will appear similar to the screenshot below, with the main body blank. Do you see that line in the main part of the screenshot? You will enter that in your own window. Here’s the code so you can copy and paste it.
6. Now you can save the file by pressing Ctrl + O (the letter, not the zero). A prompt appears at the bottom of the window with the file name that will be saved. Hit return and exit by pressing Control + X, then stop and restart Terminal for the changes to take effect.
How to install and run smartmontools
Now it is time to install the utility so that you can check the status of your Mac’s SSD. You can visit the smartmontools website for more information about the software.
1. To install smartmontools, copy and paste the code below into the Terminal (hat tip to @ marcan42).
brew install smartmontools && sudo smartctl --all /dev/disk0
Note: When you see it
zsh: command not found: brew, the PATH change did not work. Type again
nano ~/.zshrc in the window and then
2. Enter your password and press return. This will install the software and then run it. Your Terminal window should look like this before entering your password:
Smartmontools provides a handy number of data points about your Mac’s SSD. Kingston has a pdf with an explanation of the collected data points. Here are a few for quick reference.
Available spare parts: Percentage of the remaining reserve capacity available for use.
Percentage used: This is an estimate of the SSD’s lifespan.
Read data units / data units written: Note the number in brackets in terabytes The number before it is the data shown as 512-byte data units.
How to use smart montools in the future
Here’s how to run smart montools at a later date, as it’s a good idea to check your SSD from time to time to make sure it’s in good working order. If you’ve done the installation above, smartmontools will be on your Mac so you can use it whenever you want.
1. Launch Terminal and type at the prompt
diskutil list and hit return. This shows information about the SSD in your Mac.
2. Find the labeled section
/dev/disk0 (internal)Below the headers (
IDENTIFIERS), copy and paste the identification of the item that starts with
0In my situation it is
3. Go to the prompt below and type
smartctl -a, then a space and then paste the identifier. So in my situation I would type for example
smartctl -a disk0Hit Return.
Smartmontools will launch and post a report on the health of your drive. You can give the numbers a look and make sure your SSD is okay.