Check Hard Drive Serial Number in Linux
You can use the following command to check the serial number of the hard drive:
- list block devices
lsblk -o NAME,SERIAL
- The tool is called hdparm.
sudo hdparm -I /dev/sdX | grep Serial
Replace /dev/sdX with the specific name of the hard disk device.
- The udevadm commandgetline utility is used for managing device nodes in the Linux kernel.
udevadm info --query=property --name=/dev/sdX | grep ID_SERIAL
Replace /dev/sdX with the actual name of the hard drive device.
Note: When using the hdparm and udevadm commands, make sure to run them with admin privileges using sudo.