Ever needed the model number of the hard disk in your machine but been too lazy (or smart?) to open the sucker up to look? Agreed - me too. Luckily, there are a handful of tools that we can use in a *nix (probably :D - definitely in an LInUx environment) to get all that juicy hard disk gossip!
As some of these tools may not come pre-installed with your flavour of Linux, I will include the installation commands for a few parent-tier™ (I just made that up :)) disros.
For All Storage Drive Types
lshw
For Debian-based systems execute the following:
$ apt-get install lshw
For Redhat-based systems run:
$ yum install lshw
For systems with pacman e.g. Arch and Manjaro:
$ pacman -S lshw
Gentoo-based systems:
$ emerge lshw
hwinfo
For Debian-based systems execute the following:
$ apt-get install hwinfo
For Redhat-based systems run:
$ yum install hwinfo
For systems with pacman e.g. Arch and Manjaro:
$ pacman -S hwinfo
Gentoo-based systems:
$ emerge hwinfo
For Non-NVME Drives
hdparm
For Debian-based systems execute the following:
$ apt-get install hdparm
For Redhat-based systems run:
$ yum install hdparm
For systems with pacman e.g. Arch and Manjaro:
$ pacman -S hdparm
Gentoo-based systems:
$ emerge hdparm
For NVME drives
nvme
As this is not a tool that comes pre-installed with most distros it seems, you’ll have to install it from your distro’s repos. Following are some such commands:
For Debian-based systems execute the following:
$ apt-get install nvme-cli
For Redhat-based systems run:
$ yum install nvme-cli
For systems with pacman e.g. Arch and Manjaro:
$ pacman -S nvme-cli
Gentoo-based systems:
$ emerge nvme-cli
:)