Knowing the storage devices connected to a Linux system is crucial for various tasks such as system administration and maintenance. Whether you need to retrieve the available storage devices on the system, troubleshoot storage-related issues, or plan for future upgrades, knowing how to efficiently retrieve information about the storage devices is a fundamental skill. This tutorial explains how to get available storage devices on Linux.
lsblk is a Linux command line tool used to list information about block devices on a system. Block devices are storage devices like hard drives, solid-state drives (SSDs), and other storage media.
To retrieve the model names of storage devices, execute the following command:
lsblk -ndo MODEL
The output may look something like this:
Samsung SSD 990 PRO with Heatsink 2TB
Let's break down the command options step by step:
-n- this option disables the printing of the header line, making the output cleaner and easier to read.
-d- it restricts the output to listing only the block devices (disks), excluding partitions.
-o MODEL- this option specifies that we want to display the model name of each storage device.