Knowing your hard disk details β such as model, serial number, firmware version, size, cache, and speed β is crucial for diagnostics, performance tuning, or hardware inventory purposes. This guide shows you various commands to gather disk specs on Linux systems like AlmaLinux, CloudLinux, Debian, Ubuntu, and CentOS.
π Method 1: Using lsblk
β List Information About Block Devices
lsblk -o NAME,MODEL,SIZE,ROTA,TYPE,MOUNTPOINT
MODEL
: Shows disk modelROTA
: Indicates if the disk is rotational (1 = HDD, 0 = SSD)
π Method 2: Using lshw
β List Detailed Hardware Info
sudo lshw -class disk -class storage
- Shows device name, vendor, size, bus info, and more.
- Install if missing:
sudo apt install lshw # Debian/Ubuntu
sudo yum install lshw # RHEL/CentOS
sudo dnf install lshw # AlmaLinux/CloudLinux
π Method 3: Using hdparm
β Show Device Capabilities
sudo hdparm -I /dev/sdX
- Replace
/dev/sdX
with your disk (e.g.,/dev/sda
) - Shows model, firmware, serial number, cache, and more.
π Method 4: Using smartctl
β SMART Monitoring Tool
sudo smartctl -i /dev/sdX
- Displays model, serial, firmware, capacity, etc.
- To install:
sudo apt install smartmontools # Debian/Ubuntu
sudo yum install smartmontools # RHEL/CentOS
sudo dnf install smartmontools # AlmaLinux/CloudLinux
π Method 5: Using /sys
Virtual Filesystem
cat /sys/block/sdX/device/model
cat /sys/block/sdX/device/vendor
cat /sys/block/sdX/device/rev
- Direct low-level information from the kernel
π Method 6: Using inxi
β Versatile System Information Tool
inxi -Dxx
Very readable output. Use -Dxx
for detailed disk info.
- Install if needed:
sudo apt install inxi # Debian/Ubuntu
sudo yum install inxi # RHEL/CentOS
sudo dnf install inxi # AlmaLinux/CloudLinux
π Bonus: Identify if Disk is SSD or HDD
cat /sys/block/sdX/queue/rotational
- Output:
0
= SSD,1
= HDD
π‘ Tips
- You can list all your disk devices:
ls /dev/sd*
- Identify device mount points:
df -hT
π Example Output (from smartctl -i /dev/sda
)
Model Family: Seagate BarraCuda 7200.14 (AF)
Device Model: ST2000DM006-2DM164
Serial Number: Z4Z123AB
Firmware Version: CC26
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Rotation Rate: 7200 rpm
β Conclusion
Using the tools above, you can effectively audit and understand your Linux systemβs storage hardware. This can help with performance troubleshooting, disk replacements, or verifying storage quality for virtualization and backup tasks.