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.
- Readers' Choice Awards 2014 Poll
- [<Megashare>] Watch Mrs Brown's Boys Movie Online Full Movie HD 2014
- Give new life to old phones and tablets with these tips!
- Memory Ordering in Modern Microprocessors, Part I
- Source Code Scanners for Better Code
- Identifying Swift Opportunities Relating to interview transcript holocaust
- RSS Feeds
- Linux Systems Administrator
- Senior Perl Developer