How To Find Out Hard Disk Specs / Details on Linux

See all GNU/Linux related FAQ
Can you tell me a Linux command to find out information about my hard disk such as description, product name, bus type, size, and cache memory size under Linux operating systems using command line options?

Linux comes with various commands to find out information about your hard drive. I recommend hdparm command, which provides a command-line interface to various hard disk ioctls supported by the stock Linux ATA/IDE device driver subsystem. This command reads/request identification information such as disk size, description, and much more directly from the drive, which is displayed in a new expanded format. Let us see various Linux disk info commands to print hard disk drive details on screen.
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Linux terminal
Category System Management
OS compatibility AlmaLinux Alpine Arch Debian Fedora Linux macOS Mint openSUSE Pop!_OS RHEL Rocky Stream SUSE Ubuntu
Est. reading time 4 minutes

Using lsblk command to find out Linux hard disk information

Run the lsblk command as follows to lists information about all available or the specified block devices:
# lsblk
# lsblk /dev/DISK
# lsblk /dev/sda

So I have two NVMe SSD in RAID-1 mode with encrypted partitions:

nvme0n1               259:0    0 953.9G  0 disk  
├─nvme0n1p1           259:1    0   953M  0 part  /boot/efi
├─nvme0n1p2           259:2    0   3.7G  0 part  
│ └─md0                 9:0    0   3.7G  0 raid1 /boot
└─nvme0n1p3           259:3    0 949.2G  0 part  
  └─md1                 9:1    0 949.1G  0 raid1 
    └─md1_crypt       253:0    0 949.1G  0 crypt 
      ├─nixcraft-swap 253:1    0 119.2G  0 lvm   [SWAP]
      └─nixcraft-root 253:2    0 829.9G  0 lvm   /
nvme1n1               259:4    0 953.9G  0 disk  
├─nvme1n1p1           259:5    0   953M  0 part  
├─nvme1n1p2           259:6    0   3.7G  0 part  
│ └─md0                 9:0    0   3.7G  0 raid1 /boot
└─nvme1n1p3           259:7    0 949.2G  0 part  
  └─md1                 9:1    0 949.1G  0 raid1 
    └─md1_crypt       253:0    0 949.1G  0 crypt 
      ├─nixcraft-swap 253:1    0 119.2G  0 lvm   [SWAP]
      └─nixcraft-root 253:2    0 829.9G  0 lvm   /

Another option is to run the following ls command to list all disks and their names:
# ls -lF /dev/disk/by-id/
How To Find Out Hard Disk Specs and Details on Linux

Linux show block device such as hard disk drive attributes

Open the terminal app and then type the blkid command:
# blkid

/dev/sda1: UUID="35D0-69B0" TYPE="vfat" PARTUUID="50f81f2e-9c4c-43ce-896d-7a55bee67397"
/dev/sda2: UUID="985b0131-765b-4d1e-94fa-8c86491dad4d" TYPE="ext4" PARTUUID="00c44b9a-47b7-4ad3-b5ed-66a011f924b1

Use the hdparm command to find hard disk drive specification on Linux

Open the terminal and type the following command to find information about /dev/sda:
# hdparm -I /dev/sda
$ sudo hdparm -I /dev/sda
Here is what I see:


ATA device, with non-removable media
        Model Number:       ST3500630AS                             
        Serial Number:      9XXYZ845YZ
        Firmware Revision:  3.AAK   
        Supported: 7 6 5 4 
        Likely used: 7
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        CHS current addressable sectors:   16514064
        LBA    user addressable sectors:  268435455
        LBA48  user addressable sectors:  976773168
        device size with M = 1024*1024:      476940 MBytes
        device size with M = 1000*1000:      500107 MBytes (500 GB)
        LBA, IORDY(can be disabled)
        Queue depth: 32
        Standby timer values: spec'd by Standard, no device specific minimum
        R/W multiple sector transfer: Max = 16  Current = 16
        Recommended acoustic management value: 254, current value: 0
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4 
             Cycle time: no flow control=120ns  IORDY flow control=120ns
        Enabled Supported:
           *    SMART feature set
                Security Mode feature set
           *    Power Management feature set
           *    Write cache
           *    Look-ahead
           *    Host Protected Area feature set
           *    WRITE_BUFFER command
           *    READ_BUFFER command
           *    DOWNLOAD_MICROCODE
                SET_MAX security extension
           *    48-bit Address feature set
           *    Device Configuration Overlay feature set
           *    Mandatory FLUSH_CACHE
           *    FLUSH_CACHE_EXT
           *    SMART error logging
           *    SMART self-test
           *    General Purpose Logging feature set
           *    SATA-I signaling speed (1.5Gb/s)
           *    SATA-II signaling speed (3.0Gb/s)
           *    Native Command Queueing (NCQ)
           *    Phy event counters
                Device-initiated interface power management
           *    Software settings preservation
        Master password revision code = 65534
        not     enabled
        not     locked
        not     expired: security count
        not     supported: enhanced erase
Checksum: correct

lshw Command

You need to install lshw command using apt-get or yum command. To display all disks and storage controllers in the system, enter:
# lshw -class disk -class storage
From my Linux machine:

       description: Mass storage controller
       product: 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD)
       vendor: Texas Instruments
       physical id: 1.2
       bus info: pci@0000:03:01.2
       version: 00
       width: 32 bits
       clock: 33MHz
       capabilities: storage pm bus_master cap_list
       configuration: driver=tifm_7xx1 latency=64 maxlatency=4 mingnt=7
       resources: irq:19 memory:f19fa000-f19fafff
       description: SATA controller
       product: 5 Series/3400 Series Chipset 6 port SATA AHCI Controller
       vendor: Intel Corporation
       physical id: 1f.2
       bus info: pci@0000:00:1f.2
       logical name: scsi0
       logical name: scsi1
       logical name: scsi2
       version: 05
       width: 32 bits
       clock: 66MHz
       capabilities: storage msi pm ahci_1.0 bus_master cap_list emulated
       configuration: driver=ahci latency=0
       resources: irq:32 ioport:6e70(size=8) ioport:6e78(size=4) ioport:6e80(size=8) ioport:6e88(size=4) ioport:6ea0(size=32) memory:fed1e000-fed1e7ff
          description: ATA Disk
          product: TOSHIBA MK5061GS
          vendor: Toshiba
          physical id: 0
          bus info: scsi@0:0.0.0
          logical name: /dev/sda
          version: MF00
          serial: 71XYZYYYY
          size: 465GiB (500GB)
          capabilities: partitioned partitioned:dos
          configuration: ansiversion=5 signature=00025d42
          description: DVD-RAM writer
          product: BD-RE UJ232A
          vendor: MATSHITA
          physical id: 1
          bus info: scsi@1:0.0.0
          logical name: /dev/cdrom
          logical name: /dev/cdrw
          logical name: /dev/dvd
          logical name: /dev/dvdrw
          logical name: /dev/scd0
          logical name: /dev/sr0
          logical name: /media/cdrom0
          version: 1.10
          capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
          configuration: ansiversion=5 mount.fstype=udf mount.options=ro,nosuid,nodev,noexec,relatime,utf8 state=mounted status=ready
             physical id: 0
             logical name: /dev/cdrom
             logical name: /media/cdrom0
             configuration: mount.fstype=udf mount.options=ro,nosuid,nodev,noexec,relatime,utf8 state=mounted
          description: ATA Disk
          product: ST9500420ASG
          vendor: Seagate
          physical id: 0.0.0
          bus info: scsi@2:0.0.0
          logical name: /dev/sdb
          version: 0004
          serial: 5VXYZYYYY
          size: 465GiB (500GB)
          capabilities: gpt-1.00 partitioned partitioned:gpt
          configuration: ansiversion=5 guid=8795c9fc-5238-11e1-84e2-00216aca9b10

Finding Out Linux Disks Names Only

The following lshw command will quickly list installed disks including CD/DVD/BD drivers:
# lshw -short -C disk
Sample outputs:

H/W path             Device      Class       Description
/0/100/1f.2/0        /dev/sda    disk        500GB TOSHIBA MK5061GS
/0/100/1f.2/1        /dev/cdrom  disk        BD-RE UJ232A
/0/100/1f.2/1/0      /dev/cdrom  disk        
/0/100/1f.2/0.0.0    /dev/sdb    disk        500GB ST9500420ASG

Another option so to run the fdisk command as follows:
# fdisk -l
Use the grep command/egrep command to filter out loopback and other unwanted devices:
# fdisk -l | grep '^Disk /dev/'
# fdisk -l | grep '^Disk /dev/' | egrep -v '/dev/(loop|mapper|md)'

Disk /dev/nvme0n1: 953.89 GiB, 1024209543168 bytes, 2000409264 sectors
Disk /dev/nvme1n1: 953.89 GiB, 1024209543168 bytes, 2000409264 sectors

Linux GUI Disk Utility

Gnome users can use the gnome-disk-utility/gnome-disks for the following purposes:

  • Get information about installed disks and its current health.
  • Manage and configure disk drives.
  • Configure media.
  • Set up software RAID devices and more.

Type the following command or start Disk utility by visiting Applications > System Tools > Disk Utility :
# palimpsest
# gnome-disks

Linux List Hard Drives GUI Tool & Command

Fig.01: Linux List Hard Drives GUI Tool & Command - Click to enlarge

You can view disk health by clicking on the “Smart data” button (see smartd for more information):
How to determine the storage type in linux

Fig.02: Samrtdata about hard disk

The smartctl command

The smartctl command act as a control and monitor Utility for SMART disks under Linux and Unix like operating systems. Type the following command to get information about /dev/sda (SATA disk):
# smartctl -d ata -a -i /dev/sda
From my laptop:

smartctl 5.40 2010-07-12 r3124 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen,

Device Model:     TOSHIBA MK5061GSYF
Serial Number:    71XXXYYZ
Firmware Version: MF000D
User Capacity:    500,107,862,016 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Fri Feb 24 05:27:29 2012 IST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
Self-test execution status:      (  36)	The self-test routine was interrupted
					by the host with a hard or soft reset.
Total time to complete Offline 
data collection: 		 ( 120) seconds.
Offline data collection
capabilities: 			 (0x5b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					Offline surface scan supported.
					Self-test supported.
					No Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 ( 136) minutes.
SCT capabilities: 	       (0x003d)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 128
Vendor Specific SMART Attributes with Thresholds:
  1 Raw_Read_Error_Rate     0x000b   100   100   050    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   100   100   001    Pre-fail  Always       -       1650
  5 Reallocated_Sector_Ct   0x0033   100   100   050    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       34237
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       120
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       42
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       23
193 Load_Cycle_Count        0x0032   099   099   000    Old_age   Always       -       13971
194 Temperature_Celsius     0x0022   100   100   000    Old_age   Always       -       39 (Lifetime Min/Max 21/48)
199 UDMA_CRC_Error_Count    0x0032   100   100   000    Old_age   Always       -       3536073
200 Multi_Zone_Error_Rate   0x0032   100   100   000    Old_age   Always       -       9143982
240 Head_Flying_Hours       0x0032   099   099   000    Old_age   Always       -       28415
241 Total_LBAs_Written      0x0032   100   100   000    Old_age   Always       -       741418060
242 Total_LBAs_Read         0x0032   100   100   000    Old_age   Always       -       450708673
254 Free_Fall_Sensor        0x0032   100   100   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Interrupted (host reset)      40%       343         -
# 2  Short offline       Completed without error       00%       186         -
# 3  Short offline       Completed without error       00%        71         -
# 4  Short offline       Completed without error       00%         0         -
# 5  Short offline       Completed without error       00%         0         -

SMART Selective self-test log data structure revision number 1
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

A Note About RAID and SCSI Disks

Try the following commands for SCSI and hardware RAID based devices:

  1. sdparm Command – fetch SCSI / SATA device information.
  2. scsi_id Command – queries a SCSI device via the SCSI INQUIRY vital product data (VPD).
  3. Use smartctl To Check Disk Behind Adaptec RAID Controllers
  4. Use smartctl Check Hard Disk Behind 3Ware RAID Card


You learned about finding hard disk drive information on Linux. To get more information about your hard disk, refer to our other articles and tutorials:

Also do read the following manual pages using the man command or help command to find out about hard disk specs under Linux:
$ man lsblk
$ man blkid
$ man hdparm
$ man lshw
$ man fdisk
$ man smartctl

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

15 comments… add one
  • Vitaly Jan 18, 2024 @ 20:18

    df -h

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.