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.
4 hours 39 min ago
- Thanks for clearing that up.
10 hours 3 min ago
- Nice coding on the cake. I
21 hours 35 min ago
- Baker's identity
1 day 2 hours ago
- Uber jealous
1 day 7 hours ago
- Reality is disapointing
1 day 17 hours ago
- Máy sấy quần áo
1 day 20 hours ago
- Services on GlusterFS
1 day 20 hours ago
- Reply to comment | Linux Journal
1 day 22 hours ago
- Definitely cool stuff here
1 day 23 hours ago