Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

List Device Names, Drive Information, and Partitions in Linux

Get a clear overview of List Device Names, Drive Information, and Partitions in Linux, why it matters, and what readers should know.

Table of Contents

This updated guide examines List Device Names, Drive Information, and Partitions in Linux and organizes the essential facts, background, and practical takeaways in clear American English.

On systems with multiple drives, partitions, optical drives and USB drives, it may be difficult to determine the device name assigned to each drive.

What does the lsblk command do?

lsblk displays information about storage devices. This utility is often used to determine the exact device name passed to the next command.

lsblk

List Device Names, Drive Information, and Partitions in Linux — contextual image 1

In most cases, just lsblk, without any additional parameters, is sufficient to help determine the drive or partition you want to work with. For example, from the picture above, you can say that sda4 is a Windows partition, because you know its capacity is about 200GB. However, if you have two or more partitions of the same size, things can become more confusing. In other cases, you simply don't know or don't remember the capacity of a specific drive or partition on your system.

On Linux, it is dangerous to confuse the device name, because you can destroy or damage useful data with a wrong command.

Useful lsblk parameters

By default, lsblk only displays a few properties, as you saw in the image above. But, if you add parameters to the command, you can make it output additional device properties. This makes it much easier to identify the drive or partition you are looking for.

Find out if it's an SSD or a hard drive (HDD)

To see which columns lsblk can display, enter the following:

lsblk --help

In this situation, you will use ROTA and DISC-GRAN.

  • ROTA tells you whether a block device (the file represents a certain type of device, with data that can be read or written in the form of a block), usually has the ability to search forward / backward, and / or map. data) belongs to a rotary storage device. Hard disks can spin, so this column outputs a '1' next to them (binary logical value means 'true' ).
  • DISC-GRAN shows you the level of detail of discard granularity. SSDs support removal to free up unused data blocks. Hard disks do not support this feature, because they do not need it, so this column displays the value 0 .
lsblk -o +ROTA,DISC-GRAN

List Device Names, Drive Information, and Partitions in Linux — contextual image 2

Displays the file system stored on a drive or partition

When you see a list of partitions, you can know what they store, based on their size. If this is not enough, you can also create lsblk output file systems. It is much easier to define partitions this way because:

  • Windows uses the NTFS file system
  • Linux usually uses ext4
  • USB devices use FAT, FAT32 (vfat) or NTFS
  • EFI boot partitions are usually very small and show a vfat file system on them

In addition, adding a LABEL output column , may help, if the partitions were labeled when creating or formatting.

lsblk -o +FSTYPE,LABEL

Display mobile device or USB memory stick

lsblk -o +RM

This command will display an additional column telling you whether the device is removable. The value '1', synonymous with 'true', refers to a USB or other type of removable media.

Display HDD / SSD model

This is useful when you want to look up the exact code of a storage device model to upgrade the firmware or download the driver.

lsblk -d -o +MODEL

Display UUID (Universally Unique Identifier) file system

Older Linux distributions have mounted the file system by specifying their device name in '/ etc / fstab'. However, that proved to be unreliable because '/ dev / sda2' could become '/ dev / sdb2', when you add another storage device to the system. Today, the UUID is used instead, unchanged whether you add or remove anything from your computer. For whatever reason you need a UUID, you can make lsblk display them with:

lsblk -o +UUID

Show other lsblk columns you need

At the beginning of the article, you used:

lsblk --help

This command is intended to see additional columns that lsblk may display. If the examples here aren't enough for your needs, refer to that help information again and combine the parameters as needed. To do so, simply enterlsblk -o +, followed by the name of the column you want to export. Separate column names with commas. For example:

lsblk -o +SCHED,RM,FSTYPE

After determining the name of the device you want to work with, remember to replace it with the full device path in the next command you plan to use. For example, if the result is 'sda4' in lsblk, you will have to replace it with '/ dev / sda4' in the next command. So instead of 'sda4', enter '/ dev / sda4' into a command such as:

mkfs -t ext4 /dev/sda4

Hope you are succesful.

FAQ

What is List Device Names, Drive Information, and Partitions in Linux about?

It provides a structured overview of linux, explains the main context, and highlights practical takeaways for readers.

Why does this topic matter?

Understanding the main concepts helps readers evaluate the issue, avoid common mistakes, and make better-informed decisions.

How should readers use this information?

Use the guidance as a practical starting point, confirm details that may have changed, and follow current product, safety, or security recommendations.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.