In Linux, knowing how to display disk information is essential for managing storage. This includes understanding disk usage, identifying partitions, and checking disk details like model and firmware. Accessing this information helps you maintain system performance and avoid storage issues.

The steps to retrieve disk information are simple. You can use built-in commands to list disks, view partitions, and get detailed information about each disk. These commands work across most Linux distributions, including Ubuntu.

This guide provides a straightforward approach to displaying disk information in Linux. Whether you need basic disk usage data or specific details like the disk's serial number, these steps will help you get the information you need quickly.

Steps to list and view disk information:

  1. Open the terminal in your Linux system.
  2. List all available disks using the following command.
    lsblk | grep disk
    sda      8:0    0   20G  0 disk 
    sdb      8:16   0   20G  0 disk
  3. Display the partitions on each disk.
    lsblk | grep part
    ├─sda1   8:1    0    1M  0 part 
    ├─sda2   8:2    0  513M  0 part /boot/efi
    └─sda3   8:3    0 19.5G  0 part /
  4. Find the disk model and brand.
    sudo hdparm -I /dev/sda | grep Model
    Model Number:       WDC WD60EFAX-68SHWN0
  5. Retrieve the serial number of the disk.
    sudo hdparm -I /dev/sda | grep Serial
    Serial Number:      WD-WX31D43KSK3A
  6. Check the firmware version.
    sudo hdparm -I /dev/sda | grep Firmware
    Firmware Revision:  82.00A82
  7. Identify the disk's RPM speed.
    sudo hdparm -I /dev/sda | grep Rotation
    Nominal Media Rotation Rate: 5400
  8. Benchmark the disk speed.
    sudo hdparm -tT /dev/sda
    /dev/sda:
    Timing cached reads:   27522 MB in  2.00 seconds = 13783.98 MB/sec
    Timing buffered disk reads: 1976 MB in  3.00 seconds = 658.03 MB/sec

    The above benchmarks test the read speed of the disk. Cached reads show the speed from memory, while buffered reads show the speed from the disk.

  9. View the SMART health status.
    sudo smartctl -H /dev/sda
    SMART Health Status: OK

    The SMART status provides a quick health check of the disk.

  10. Show the UUID of disks and partitions.
    blkid
    /dev/sda3: UUID="a7d71686-0a65-4402-b6e6-b58430ef8351" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="0ea90c96-1b56-4c51-b07a-02e09285f291"
  11. Display usage and free space for all mounted disks.
    df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda3        20G  7.4G   11G  41% /
  12. Check the hard drive temperature.
    sudo hddtemp /dev/sda
    /dev/sda: TOSHIBA MQ01ACF050: 39°C
  13. Review disk-related kernel messages.
    sudo dmesg | grep sda
    [    3.439451] sd 32:0:0:0: [sda] 41943040 512-byte logical blocks: (21.5 GB/20.0 GiB)
    [    3.439497] sd 32:0:0:0: [sda] Write Protect is off
    [    3.458951]  sda: sda1 sda2 sda3
Discuss the article:

Comment anonymously. Login not required.