This article contains a few practical commands for checking physical disks, models, sizes and disk health on Ubuntu 24.04. It covers SATA/SAS HDD and SSD drives as well as NVMe devices.
Check Disk Model and Size
The quickest way to list physical disks together with their model, size, type and transport interface:
lsblk -d -o NAME,MODEL,SIZE,ROTA,TYPE,TRAN
NAME MODEL SIZE ROTA TYPE TRAN
sda ST4000NM0035-1V4107 3.6T 1 disk sata
sdb Samsung SSD 870 EVO 1TB 931.5G 0 disk sata
nvme0n1 SAMSUNG MZQL23T8HCLS-00A07 3.5T 0 disk nvme
ROTA 1 means a rotating HDD, while ROTA 0 normally means SSD or NVMe storage.
Check Disk Partitions and Filesystems
Display disks, partitions, filesystems, UUIDs and mount points:
lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sda
└─sda1 ext4 1.0 11b52db8-7434-4d91-a7db-f61d8c21c235 2.9T 14% /data
nvme0n1
├─nvme0n1p1 vfat FAT32 85B4-8E1D 900M 5% /boot/efi
└─nvme0n1p2 ext4 1.0 358948b8-f9a0-469e-8994-c4c134d86768 1.8T 42% /
Install SMART tools for SATA/SAS drives and the NVMe command-line utility:
sudo apt update
sudo apt install smartmontools nvme-cli -y
Use smartctl to display the complete SMART information for a disk:
sudo smartctl -a /dev/sda
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.8.0-xx-generic] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Enterprise Capacity 3.5 HDD
Device Model: ST4000NM0035-1V4107
Serial Number: ZC123456
LU WWN Device Id: 5 000c50 0abcdef01
Firmware Version: TN02
User Capacity: 4,000,787,030,016 bytes [4.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
9 Power_On_Hours 0x0032 082 082 000 Old_age Always - 15872
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
Check Important SMART Health Values
The most useful values when checking an HDD or SATA SSD are:
sudo smartctl -a /dev/sda | grep -E "Power_On_Hours|Reallocated_Sector|Current_Pending|Offline_Uncorrectable|Reported_Uncorrect"
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
9 Power_On_Hours 0x0032 082 082 000 Old_age Always - 15872
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
Power_On_Hours shows how many hours the disk has been powered on. Reallocated, pending and uncorrectable sectors should normally remain at zero.
Check SMART Overall Health
For a quick disk health check:
sudo smartctl -H /dev/sda
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
List NVMe Disks
Use nvme-cli to list all detected NVMe devices:
sudo nvme list
Node Generic SN Model Namespace Usage Format FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme0n1 /dev/ng0n1 S64XXXXXXXXX SAMSUNG MZQL23T8HCLS-00A07 0x1 3.84 TB / 3.84 TB 512 B + 0 B GDC5A02Q
Check NVMe Health and Lifetime
The NVMe SMART log contains temperature, lifetime usage, power-on hours, data written, unsafe shutdowns and media errors:
sudo nvme smart-log /dev/nvme0
Smart Log for NVME device:nvme0 namespace-id:ffffffff
critical_warning : 0
temperature : 36 °C (309 K)
available_spare : 100%
available_spare_threshold : 10%
percentage_used : 3%
endurance group critical warning summary: 0
Data Units Read : 15,284,331 (7.83 TB)
Data Units Written : 29,923,411 (15.32 TB)
host_read_commands : 198,442,722
host_write_commands : 331,702,119
controller_busy_time : 1,243
power_cycles : 38
power_on_hours : 12,438
unsafe_shutdowns : 4
media_errors : 0
num_err_log_entries : 0
The most important NVMe values are percentage_used, power_on_hours, unsafe_shutdowns and media_errors. A healthy NVMe drive should normally report zero media errors.
Display controller metadata such as model, serial number, firmware revision and PCI vendor information:
sudo nvme id-ctrl /dev/nvme0 | grep -E "sn |mn |fr |vid |ssvid"
vid : 0x144d
ssvid : 0x144d
sn : S64XXXXXXXXX
mn : SAMSUNG MZQL23T8HCLS-00A07
fr : GDC5A02Q
Check NVMe Error Log
Display the NVMe controller error log:
sudo nvme error-log /dev/nvme0
Error Log Entries for device:nvme0 entries:64
.........................
Entry[ 0]
.........................
error_count : 0
sqid : 0
cmdid : 0
status_field : 0(SUCCESS)
parm_err_loc : 0
lba : 0
nsid : 0
Quick Disk Health Check
For SATA or SAS disks:
sudo smartctl -H /dev/sda
sudo smartctl -a /dev/sda
For NVMe disks:
sudo nvme list
sudo nvme smart-log /dev/nvme0
sudo nvme error-log /dev/nvme0