If you want to be able to manage your storage, the first task is that you need to find out
which blocks devices you have.
Depending on the driver that is used, different block devices may occur.
And you can use LSBLK to get an overview of the currently existing devices.
You may find DEV NVMe X and Y, where X and Y are numbers.
And that is used for NVMe devices.
NVMe is the standard on much high-end hardware.
You can also find DEV SDA and SDB and SDC and so on for SCSI and STATA disks.
Or DEV VDABC and so on for KVM virtual machines.
It really depends on the storage that you have.
So you need LSBLK to figure out.
Let's have a quick look.
So here we have LSBLK.
And what do we see?
We see a couple of block devices.
Let's start with the most important ones, which are NVMe 0 and 1 and NVMe 0 and 2, which
are my two hard disks.
Kind of funny.
I started with NVMe 0 and 1.
And then I added a new hard disk.
But this new hard disk has become NVMe 0 and 1.
And the old one has suddenly become NVMe 0 and 2.
I'll later explain why that is not a big deal at all.
So on these hard disks, we can see the partitions.
And on this partition, we can even see some logical volumes.
All the devices are SR0 for my optical disk device and loop 0, which is what I need to
mount an ISO file.
The loop device is a fake device that allows you to mount files as if they were block devices.
Now as you have seen in the LSBLK output, you get partitions.
And on SD and VD devices, the partitions are numbered in order.
So DevSD A2, for instance, is the second partition on the first hard disk.
And DevSD B1 is the first partition on the second hard disk.
On NVMe devices, partition names are appended to the device name.
So you would get a partition name like Dev NVMe 0 and 1 P1, where P1 is partition number
1 on NVMe 0 and 1, which is the first hard disk.
Or NVMe 0 and 3 P2, which would be the second partition on the third hard disk.
I would always advise to use LSBLK to avoid confusion.
And for your information, LSBLK reads the kernel partition table in the PROC PARTITIONS
file.
So if you like information that's a bit harder to read, feel free to have a look at PROC
PARTITIONS as well.
Let me show you.
So still on the screen, you can see LSBLK output.
And when I use CAT on PROC PARTITIONS, there we can see the same information from a kernel
perspective.
That's less readable, isn't it?
And that's because the PROC file system was never intended for human usage.
For human usage, there is these front-end utilities like LSBLK.
But it's always good to know how to find the information in slash PROC.
In advanced situations, it might help you to troubleshoot.