A disk name such as /dev/sda is convenient for the kernel, but it tells you almost nothing about the piece of hardware in the rack, the USB enclosure on the desk, or the drive bay behind a hot-swap backplane. The letter is assigned during device enumeration, so it can change after a reboot, a controller swap, or a new disk is added. Before you format, replace, or unplug a drive, confirm the mapping from the block device name to a model, serial number, bus path, and system role.
This tutorial starts from a device name and works outward: first with lsblk, then through the kernel's SCSI and sysfs view, then through persistent identifiers and direct drive queries. It ends with a safety checklist for remote systems, USB disks, and hardware RAID.
Table of Contents
- Start With the Block Device, Not the Letter
- Cross-Check the Kernel View: SCSI Address and Bus Path
- Confirm the Drive by Model and Serial
- Identify the Boot and Root Disk
- Safety Checklist Before Formatting or Unplugging
- Conclusion
Start With the Block Device, Not the Letter
A block device is a device that moves data in fixed-size blocks, such as a hard drive, SSD, or USB stick. Linux exposes each one as a node under /dev, and the sd prefix means the device is handled through the SCSI disk driver. SATA, SAS, and most USB storage all pass through that subsystem, so they can appear as /dev/sda, /dev/sdb, and so on. NVMe drives normally use names such as /dev/nvme0n1 instead.
The kernel does not promise that sda will always be the same physical drive. Red Hat's guide to persistent naming attributes notes that traditional names are assigned by enumeration order and can change when devices are added or removed, when the hardware configuration changes, or after a reboot. Treat the letter as a temporary handle, not an identity.
Start with a full inventory that includes the fields you actually need:
lsblk -d -o NAME,SIZE,TYPE,MODEL,SERIAL,TRAN,WWN
The -d option means "no dependencies," so lsblk prints whole disks without their partitions. Remove it when you want the tree view:
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS,MODEL,SERIAL,TRAN,WWN
A typical result looks like this:
| NAME | SIZE | TYPE | MODEL | SERIAL | TRAN |
|---|---|---|---|---|---|
| sda | 1.8T | disk | Samsung SSD 870 EVO 1TB | S5Y2NX0T123456 | sata |
| sdb | 3.6T | disk | WDC WD40EFRX-68N32N0 | WD-WCC7K0ABCDEF | sata |
| sdc | 1.8T | disk | Seagate Expansion | NA123456 | usb |
The MODEL and SERIAL columns are the first useful anchors. Model alone is not enough because a batch of identical drives will share it; the serial number is what you match against the label on the drive. The TRAN column shows the transport, such as sata, usb, sas, or nvme, when the kernel can determine it. WWN is the World Wide Name, a storage identifier that is generally unique to the device.
lsblk gathers its information from sysfs and the udev database, and the util-linux lsblk manual page recommends always naming the columns you need with --output in scripts because the default output can change between versions. That is especially important here: a script that parses lsblk output should ask for NAME, SERIAL, and MODEL explicitly.
If a field is blank, do not guess. Virtual disks, cheap USB bridges, and some RAID controllers do not pass through a real model or serial. You will need a second method.
Cross-Check the Kernel View: SCSI Address and Bus Path
Kernel messages often identify a disk with a four-part SCSI address such as 0:4:0:0. The parts are host, channel, target, and LUN (logical unit number). The lsscsi utility prints the same tuple and maps it to the device node, which makes it a direct way to answer, "Which disk is sd 0:4:0:0?"
lsscsi
[0:0:0:0] disk ATA Samsung SSD 870 2B6Q /dev/sda
[2:0:0:0] disk ATA WDC WD40EFRX-68N 0A82 /dev/sdb
[4:0:0:0] disk Seagate Expansion 0304 /dev/sdc
If you already have the address, pass it as a filter. This prints only the matching device:
lsscsi 0:4:0:0
The upstream lsscsi documentation explains that the first field is the host, channel, target, and LUN tuple, and that the last field is the primary device node. It also shows how -g adds the SCSI generic node (/dev/sgN), -t shows transport details, and -H lists the SCSI hosts or controllers. That is useful when you need to know not just the model but which HBA or USB controller the drive is attached to:
lsscsi -g
lsscsi -t
lsscsi -H
The kernel's own view is under /sys. The Linux kernel sysfs documentation notes that /sys/block/ contains symlinks to all block devices discovered on the system, and those links point into directories under /sys/devices. Resolve the link to see the physical device path:
readlink -f /sys/block/sda
readlink -f /sys/block/sda/device
The first command typically returns a path containing the controller and target; the second resolves the SCSI device directory. When the driver exposes them, you can read attributes directly:
cat /sys/block/sda/device/model
cat /sys/block/sda/device/serial
The resulting path is often the most useful clue for a bay or port. A SATA disk may resolve through a path containing ata1/host0/target0:0:0/0:0:0:0, while a USB disk may resolve through a usb2/2-1/... path. That path is topology, not a random name: it reflects where the device is connected.
For a more readable port mapping, list the persistent path links:
ls -l /dev/disk/by-path/
You will see entries such as pci-0000:00:17.0-ata-1 -> ../../sda. Red Hat's persistent naming documentation describes by-path as being based on physical hardware placement, such as the slot or port where a disk is connected. On a server with numbered bays, this is often the fastest way to translate a device name into a physical location. For a broader catalog of block-device listing commands and their options, see this guide to Linux commands for listing block devices.
Confirm the Drive by Model and Serial
Once you have a candidate device, confirm it with a persistent identifier. The /dev/disk/by-id/ directory contains udev-created symlinks built from hardware attributes. Red Hat's documentation describes these names as a combination of vendor, model, and serial string, and notes that by-id, by-path, by-uuid, and related links are the stable alternatives to kernel-assigned names.
ls -l /dev/disk/by-id/
Look for names beginning with ata-, wwn-, usb-, or scsi-. A typical entry looks like:
ata-Samsung_SSD_870_EVO_1TB_S5Y2NX0T123456 -> ../../sda
wwn-0x5002538e40a1b2c3 -> ../../sda
The ata- name embeds the model and serial, while the wwn- name uses the drive's World Wide Name. Both are far more meaningful than sda. You can also ask udev for every link associated with the device:
udevadm info --query=property --property=DEVLINKS --value /dev/sda
For a direct query to the drive itself, hdparm -I requests identification information from the device rather than reading a cached sysfs value. On SATA and IDE drives it reports the model, serial, firmware, and often the LU WWN:
sudo hdparm -I /dev/sda | grep -E 'Model Number|Serial Number|LU WWN'
The hdparm manual page notes that it works through the kernel's SATA/PATA/SAS libata subsystem and that some USB enclosures support SAT (SCSI-ATA Command Translation), so -I may work through those bridges too. It is not universal: if the enclosure does not translate the command, use the enclosure's own tools or check the bridge serial.
lshw provides another independent view that combines bus information with disk attributes. Its lshw manual page notes that it must be run as superuser to report complete information, and its -businfo option shows SCSI, USB, IDE, and PCI addresses:
sudo lshw -class disk -short
sudo lshw -class disk -businfo
The full lshw -class disk output usually includes a logical name, product, vendor, serial, and bus info. Cross-checking lsblk, hdparm, and lshw is a good habit because they collect data in different ways: sysfs and udev, a direct ATA identify command, and a hardware inventory scan.
No single method is perfect. A USB enclosure may report the bridge's serial instead of the drive's serial, and two identical adapters may even report the same value. A hardware RAID controller may present a logical volume as /dev/sda while hiding the member disks entirely. A virtual machine may use a synthetic serial that has no relation to the host's physical drive. In those cases, the device name identifies the presented volume, not necessarily the piece of hardware you can hold.
Identify the Boot and Root Disk
Before touching any disk, identify the boot and root devices. The safest starting point is the mounted filesystem table, not the sd letter. The findmnt manual page explains that it searches the kernel mount table and can print just the source device for a path:
findmnt -n -v -o SOURCE /
findmnt -n -v -o SOURCE /boot
findmnt -n -v -o SOURCE /boot/efi
The -n option suppresses the header, -o SOURCE selects only the source column, and -v avoids printing a [/subvolume] suffix for bind mounts or Btrfs subvolumes. If / is on LVM, the source may be /dev/mapper/vg-root; if it is on a RAID array, it may be /dev/md0. Either way, that is the filesystem you must not damage.
To walk from that source back to the physical disk, use lsblk in inverse order. The -s option prints dependencies in reverse, so an LVM logical volume leads back through its physical volume to the underlying partition and disk:
lsblk -s -o NAME,TYPE /dev/mapper/vg-root
NAME TYPE
vg-root lvm
└─sda3 part
└─sda disk
For a plain partition, the same technique works:
lsblk -s -o NAME,TYPE /dev/sda2
You can also view the whole hierarchy with mount points in one pass:
lsblk -o NAME,TYPE,SIZE,FSTYPE,MOUNTPOINTS
Confirm that the candidate disk is not mounted anywhere and is not the parent of a mounted filesystem. findmnt -S /dev/sda1 checks a specific source, and lsblk shows mount points for every partition. On a system with LVM, MD RAID, or device-mapper multipath, the disk may not appear directly as a mount source; it appears as a parent in the lsblk tree. That is exactly why the inverse lookup matters.
Do not assume the boot disk is sda. Enumeration order is not a boot-order guarantee. The drive that was sda in the installer may be sdb after a controller is added, and a USB installer can take sda on one boot and sdb on the next. Confirm the root device by its serial or WWN, not by its position in the list.
Safety Checklist Before Formatting or Unplugging
Once you believe you have the right disk, slow down and verify the destructive step from several angles. wipefs, documented in the wipefs manual page, is a useful inspection tool before any format: run without options and it lists visible filesystem, RAID, and partition-table signatures without erasing anything.
sudo wipefs /dev/sda
The tool is explicit that it does not erase the filesystem itself or other data; it erases signatures so that libraries such as libblkid no longer recognize them. That is still dangerous on the wrong device, because it can make an existing array or filesystem unbootable. Use -n for a dry run before -a, and use --backup if you are intentionally wiping:
sudo wipefs -n -a /dev/sda
A practical pre-destructive checklist:
-
Match the serial from
lsblk -o SERIAL,/dev/disk/by-id/, orhdparm -Ito the label on the physical drive. -
Match the port from
/dev/disk/by-path/orreadlink -f /sys/block/sda/deviceto the bay or slot you intend to service. -
Check mounts with
findmnt -S /dev/sda1,findmnt -n -o SOURCE /, andlsblk -o NAME,MOUNTPOINTS. -
Check holders and layers with
ls /sys/class/block/sda/holders,pvs, andcat /proc/mdstatwhen LVM or RAID is in use. -
Check swap with
swapon --show; a swap partition will not necessarily appear as a normal mount. -
Exclude the boot and root disks you identified in the previous section, including any separate
/bootor EFI system partition.
On a remote server, do not rely on memory or a ticket description. Use an out-of-band console or IPMI/iDRAC/iLO session if available, and ask a person on site to read the drive label or confirm a location LED before you remove anything. A serial number in a terminal is only useful if it matches the sticker on the hardware.
USB disks deserve extra caution. A removable drive can be the installer you booted from, and unplugging it can remove the running root filesystem. Check TRAN in lsblk, the usb- links in /dev/disk/by-id/, and the usb... path in sysfs before pulling a cable. If the enclosure reports only a bridge serial, identify it by its port path and physical label rather than assuming the serial belongs to the disk inside.
Hardware RAID is the other common trap. When a controller presents a single logical volume, /dev/sda may represent the array, not any individual member. lsblk, hdparm, and lshw can only see what the controller exposes. To map a logical volume to a physical slot, use the controller's management utility or its out-of-band interface; pulling a drive based on the sd letter alone can degrade or destroy the array.
Conclusion
To find which physical disk is /dev/sda, build the identification from several independent signals instead of trusting the letter. Start with lsblk -o NAME,MODEL,SERIAL,TRAN,WWN, use lsscsi and sysfs to translate a SCSI tuple or bus path, then confirm the model and serial through /dev/disk/by-id/, hdparm -I, or lshw. Before any destructive command, use findmnt and lsblk -s to identify the boot and root disks, and check mounts, holders, swap, and RAID members. The final confirmation should be a serial number or WWN that matches the physical hardware, not a device name that may change on the next boot.
Top comments (0)