Here are several useful commands to get hard drive information on Ubuntu:
Basic Drive Information
lsblk – Lists all block devices in a tree format
lsblk
Shows drives, partitions, and mount points. Add -f for filesystem info:
lsblk -f
sudo fdisk -l – Lists all disks and partitions with detailed info
sudo fdisk -l
df -h – Shows disk space usage for mounted filesystems
df -h
Detailed Drive Information
sudo hdparm -I /dev/sda – Shows detailed info about a specific drive
sudo hdparm -I /dev/sda
(Replace /dev/sda with your drive name)
sudo smartctl -a /dev/sda – Shows SMART health data
sudo smartctl -a /dev/sda
(You may need to install with: sudo apt install smartmontools)
sudo parted -l – Lists partition tables for all drives
sudo parted -l
blkid – Shows UUIDs and filesystem types
sudo blkid
Drive Model and Serial Number
lshw – Comprehensive hardware info
sudo lshw -class disk -class storage
Each command provides different information, so you can choose based on what you need to know about your drives!
Be First to Comment