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.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Server Hardening
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- The Humble Hacker?
- The Death of RoboVM
- Why Python?
- The US Government and Open-Source Software
- EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager
- On Your Marks, Get Set...Gutsy Gibbon!
- Open-Source Project Secretly Funded by CIA
- ACI Worldwide's UP Retail Payments
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide