Updated: 12 October 2026 · Applies to: physical disks on Linux servers and PCs: Ubuntu 24.04 (util-linux 2.39, smartmontools 7.4, nvme-cli 2.8), Debian 13 (smartmontools 7.4), AlmaLinux and Rocky Linux 10 (smartmontools 7.4, nvme-cli 2.16)
To test an SSD in Linux, first confirm it really is one with lsblk -d -o NAME,ROTA,TRAN,MODEL (ROTA 0 means solid-state), then check its health with sudo smartctl -H /dev/sda (or /dev/nvme0), let the drive test itself with sudo smartctl -t short, and confirm TRIM works with lsblk -D. Speed is a separate test with fio.
These steps are for physical drives, for example in a dedicated server or your own PC. A VPS has a virtual disk that does not show the real drive type or SMART data; to check a VPS, see how to verify whether a VPS is on SSD.
1. Check whether the disk is an SSD or a hard disk
lsblk -d -o NAME,ROTA,TYPE,SIZE,MODEL,TRAN
ROTA 0: non-rotational, an SSD or NVMe drive.ROTA 1: a spinning hard disk (HDD).TRANshows the connection, for examplesata,sas,nvmeorusb. NVMe drives are namednvme0n1,nvme1n1and so on.MODELis the drive model, which you can look up on the maker's website.
The same flag can be read straight from the kernel with cat /sys/block/sda/queue/rotational (0 for SSD, 1 for HDD; replace sda with your disk). Here is the output from the virtual disk of our test server, a lab example that shows why this check does not work on virtual machines:
$ lsblk -d -o NAME,ROTA,TYPE,SIZE,MODEL,TRAN NAME ROTA TYPE SIZE MODEL TRAN sda 1 disk 50G QEMU HARDDISK ata
The hypervisor presents an emulated "hard disk", so it reports ROTA 1 whatever storage the host really uses.
2. Confirm the drive type with smartctl
- Install smartmontools:
sudo apt install smartmontools(Ubuntu, Debian) orsudo dnf install smartmontools(AlmaLinux, Rocky Linux). - Show the drive information:
sudo smartctl -i /dev/sda - On SATA drives, the
Rotation Rate:line readsSolid State Devicefor an SSD or a speed such as7200 rpmfor a hard disk. SATA SSDs also show aTRIM Command:line, for exampleAvailable.
For NVMe drives, use the controller name: sudo smartctl -i /dev/nvme0. Behind a hardware RAID controller, add the controller type, for example sudo smartctl -i -d megaraid,0 /dev/sda for the first disk on a MegaRAID controller.
3. Check the SSD health
sudo smartctl -H /dev/sda sudo smartctl -a /dev/nvme0
The health line reads SMART overall-health self-assessment test result: PASSED, or FAILED! when the drive has failed or, according to the smartctl manual, predicts its own failure within 24 hours. Back up a failing drive straight away.
On an NVMe drive, look at these lines in the smartctl -a output:
Percentage Used: the drive's own estimate of how much of its rated endurance is used up.Available Spare: spare flash left to replace worn blocks; it falls as the drive wears.Media and Data Integrity Errors: should stay at 0.
sudo nvme smart-log /dev/nvme0 from the nvme-cli package shows the same values as percentage_used, available_spare and media_errors. On SATA SSDs, the wear attribute names differ from maker to maker. More on reading SMART values in how to install and use smartctl.
4. Run the drive's self-test
- Start a short test:
sudo smartctl -t short /dev/sda. smartctl replies withPlease wait N minutes for test to complete.; according to the smartctl manual, a short test usually takes under ten minutes. - When the time is up, read the result:
sudo smartctl -l selftest /dev/sda. The newest test is at the top and should sayCompleted without error. - For a full surface check, run
sudo smartctl -t long /dev/sda, which takes tens of minutes to several hours.
The drive runs the test itself, and according to the manual you can keep using the server while it runs. NVMe drives that support self-tests take the same commands with /dev/nvme0. To get an email when a drive starts to fail, set up smartd as in how to monitor disk health with smartd.
5. Check that TRIM works
TRIM tells the SSD which blocks are free, which keeps write speed up over time. Check that the disk accepts it:
$ lsblk -d -D NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO sda 0 512B 2G 0
Non-zero DISC-GRAN and DISC-MAX values (here from our test server's virtual disk) mean the device accepts discard (TRIM) requests; zeros mean it does not, for example when a RAID controller does not pass TRIM through. On Ubuntu 24.04 and AlmaLinux 10, the fstrim.timer service is enabled by default and trims mounted file systems once a week. Check it with systemctl status fstrim.timer, and run a trim by hand with sudo fstrim -av.
6. Test the SSD speed
The health checks do not measure speed. Use fio as described in how to test disk speed on Linux. As a rough guide, random 4K reads in the tens of thousands of IOPS point to an SSD or NVMe drive, while a hard disk manages a few hundred.
Common problems
- All disks show ROTA 1 on a dedicated server: they may sit behind a RAID controller that hides the drive type. Use
smartctl -dwith the controller type, or the controller's own tool. - smartctl: Unable to detect device type: add the right
-doption, and run it on the whole disk (/dev/sda,/dev/nvme0), not on a partition or LVM volume. - Smartctl open device: /dev/sda failed: No such device: we got this inside a container, which has no access to the real disk. Run smartctl on the host itself.
- No SMART data on a VPS: expected, because the disk is virtual. The provider monitors the physical drives.
Our unmanaged dedicated servers come with full root access and free IPMI KVM, so you can run all of these checks on the real drives. For the difference between drive types, see the difference between HDD and SSD.
Official documentation: the smartctl manual and the Linux kernel sysfs-block documentation (see queue/rotational).
