How to identify physical disks in your NAS: Guide to lsblk, smartctl e lshw
Anyone who runs a DIY server or home NAS has found themselves in that panic situation at least once “from missing label”, staring four identical drives into the case and praying you don't take out the wrong one during a migration or failure.
If you have a mixed setup with a pool mergerfs, records of backup and units dedicated to video surveillance, Correctly identifying the physical device is essential. Here are the software tools to map your hardware before you pick up the screwdriver.
1. Tree view with lsblk
The command lsblk it is the starting point. It allows you to see the structure of the disks, mount points and filesystem labels.
lsblk -o NAME,SIZE,FSTYPE,LABEL,MOUNTPOINT,MODEL
Example output:
NAME SIZE FSTYPE LABEL MOUNTPOINT MODEL
sda 500G ext4 system / Samsung 870 EVO
sdb 4T ext4 mergerfs_data1 /mnt/disk1 WDC WD40EFRX
sdc 4T ext4 mergerfs_data2 /mnt/disk2 WDC WD40EFRX
sdd 2T ext4 videosurv /mnt/cam ST2000VX008
In this example, thanks to the column LABEL and MODEL, we know right away that sdd it is the Seagate disk dedicated to cameras, while the others are the Western Digitals of the data pool.
2. The litmus test: smartctl and the Serial Number
If the disks are identical (same make and model), the only way to physically distinguish them is Serial number (S/N) printed on the label. smartctl (part of the package smartmontools) it is the definitive command.
sudo smartctl -i /dev/sdb
Look for the line relating to Serial Number:
Model Family: Western Digital Red
Device Model: WDC WD40EFRX-68N32N0
Serial Number: WD-WCC7K1XXXXXX
3. Partition analysis with fdisk
If you need to understand how a disk is partitioned (for example to identify old remnants of a RAID or swap partitions), usa fdisk.
sudo fdisk -l /dev/sdb
This command will show you the “Disk identifier” and the exact list of partitions present (this is. Linux RAID autodetect o GPT).
4. Hardware map with lshw
While the previous commands focus on data, lshw he tells you “where” the disk is connected at the hardware bus level. This is very useful if you have additional SATA controllers.
sudo lshw -class disk -short
It will return you a table with the H/W path, allowing you to distinguish disks connected directly to the motherboard from those on PCI-Express cards or external enclosures.
My advice: Before proceeding with physical removal, always throws
smartctlto get the serial number and write it on a post-it. Once you open the NAS, compare it with the disc label to be sure of the 100%.



0 Comments