lsblk
what disks are attachedlsblk — list block devices — shows every disk and the partitions on it, with sizes and mount points. It is the command to run before touching a disk, to be sure which device is which.
Before any command that writes to a disk, lsblk tells you its real name.
At the terminal
Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.
What the numbered lines are telling you
RM is 1 for removable media, RO is 1 for read-only, TYPE says disk or partition, and MOUNTPOINTS is where it appears in the tree.
sda is the first disk, 100 GB. The lines drawn beneath it are its partitions.
sda2 holds the root filesystem. Its contents are what you see at /.
RM is 1 and the size is 14.9G: removable. The empty MOUNTPOINTS column means its files are not yet reachable.
Switches
A switch changes how the command behaves. These are the ones used day to day; man lsblk lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.
-f- Show filesystem type, label, UUID and mount point.
-o COLUMNS- Choose the columns, such as NAME,SIZE,MODEL.
-d- List whole disks only, not partitions.
-p- Print full device paths: /dev/sda1.
-b- Print sizes in bytes.
-J- Print JSON, for scripts.
Variations worth knowing
The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.
lsblk -fAdds the filesystem type, label and UUID of each partition.
lsblk -o NAME,SIZE,MODEL,SERIALChooses the columns — here, to identify the physical drives.
lsblk -dLists whole disks only, without their partitions.
sudo blkidPrints the UUID and type of every partition, for use in /etc/fstab.
In cybersecurity
Most disk disasters are the right command run on the wrong device.
Names such as sdb are handed out in the order disks are found and can change between boots. Check size and model with lsblk before dd, mkfs or fdisk.
A disk or USB device nobody recalls attaching is worth explaining — on a server, removable media should be rare.
A partition of type crypt is encrypted with LUKS. A laptop whose data partition is not is readable by whoever takes the disk out.