How to check Disk is SSD or HDD on Linux

Introduction

In this tutorial, How to check Disk is SSD or HDD on Linux. Solid-state drives (SSDs) are fast, silent, and less prone to failure than traditional hard disk drives (HDDs).

  • HDD store information on a rotating disk known as a platter
  • SSD use flash memory to store and persist data.
lsblk Command:
  • Purpose: Lists all available block devices along with detailed information.
  • Output Details: Displays device names, mount points, size, and type.
  • Use Case: Helps system administrators quickly overview the system's disk layout.
  • Options: Offers options to include or exclude specific details or device types.
cat Command:
  • Purpose: Displays the content of files or concatenates files.
  • Primary Use: Commonly used to view contents of small files.
  • Concatenation: Can merge several files into one, e.g., cat file1 file2 > combinedfile.
  • Flexibility: Useful for displaying file contents quickly or for file manipulation.

Using lsblk command to check HDD or SSD

lsblk -o name,rota | tail
If you get a 1 then the disk is an HDD. A 0 (zero) on the column rota is SSD.

The output terminal as below:

How to check Disk is SSD or HDD on Linux

Using the cat Command

cat /sys/block/sda/queue/rotational
If the result is 1, then the disk is an HDD. the output 0 ( zero) that disk is ssd.

The output terminal as below:

Check Disk is SSD or HDD on Linux
 

Conclusion

Identifying whether your disk is an SSD or HDD in Linux is a crucial step for optimizing system performance and ensuring efficient data management. By utilizing the commands discussed, such as lsblk, hdparm, and smartctl, users can effectively determine their disk type and make informed decisions about system configurations and upgrades. This knowledge not only enhances your troubleshooting skills but also helps in maximizing the lifespan and functionality of your storage devices. Remember, the correct identification and understanding of your disk type is key to tailoring your Linux system to meet your performance and storage needs. Thank you for reading HuuPhan.com page!

Comments

Popular posts from this blog

zimbra some services are not running [Solve problem]

How to install php7 on centos 6: A Step-by-Step Guide

Bash script list all IP addresses connected to Server with Country Information