Tech Tip: Retrieve Disk Info from the Command Line
You can use the following command line tools to retrieve the make and model of your hard drives without the need to open up your system.
First, you need the device names of your disks, for this you can use df or cat /proc/partitions. Example device names are names such as /dev/hda or /dev/sdb. For the following examples, where applicable, I will use /dev/sda as my disk device.
Use the lshw command:
$ lshw -class disk ... -disk:0 product: ST3250310NS vendor: Seagate version: SN04 serial: 9SF0000TH size: 232GiB (250GB)
Use the smartctl command:
$ smartctl -i /dev/sda ... Device Model: ST3250310NS Serial Number: 9SF0000TH Firmware Version: SN04 ...
Note: You may need to install the 'smartmontools' package, your output will vary depending on smartctl version and disk make/model.
Use the hdparm command:
$ hdparm -i /dev/sda /dev/sda: Model=ST3250310NS, FwRev=SN04, SerialNo=9SF0000TH ...
Use the hwinfo command:
$ hwinfo --disk ... Model: "ST3250310NS" Device: "ST3250310NS" Revision: "SN04" Serial ID: "9SF0000TH" ...
Note: You may need to install the 'hwinfo' package.
Note, you will need to be root to get the full output from these commands.
And one additional way that you can determine the model and serial number of your disk:
$ ls /dev/disk/by-id ata-ST3250310NS_9SF0000TH ata-ST3250310NS_9SF0000TH-part1 ata-ST3250310NS_9SF0000TH-part2 ata-ST3250310NS_9SF0000TH-part3
Here the model number is ST3250310NS, and the serial number is 9SF0000TH.
|Nightfall on Linux||Oct 26, 2016|
|Daily Giveaway - Fun Prizes from Red Hat!||Oct 25, 2016|
|Installing and Running a Headless Virtualization Server||Oct 25, 2016|
|Ubuntu MATE, Not Just a Whim||Oct 21, 2016|
|Non-Linux FOSS: Screenshotting for Fun and Profit!||Oct 20, 2016|
|Nasdaq Selects Drupal 8||Oct 19, 2016|
- Nightfall on Linux
- Installing and Running a Headless Virtualization Server
- Secure Desktops with Qubes: Compartmentalization
- Daily Giveaway - Fun Prizes from Red Hat!
- Ubuntu MATE, Not Just a Whim
- Nasdaq Selects Drupal 8
- Build Your Own Raspberry Pi Camera
- Non-Linux FOSS: Screenshotting for Fun and Profit!
- Canonical Ltd.'s Ubuntu Core
- Polishing the wegrep Wrapper Script