How to Check the Disk Manufacturer on a Linux Server

How to Check the Disk Manufacturer on a Linux Server

When managing a Linux server, it’s crucial to know the details of your hardware, including the storage devices. Whether you’re troubleshooting performance issues or inventorying your hardware, knowing the make and model of your disk can provide valuable insights. In this guide, I’ll show you how to check the make of your disk using simple commands in the Linux terminal.

Why Check the Disk Manufacturer?

Identifying your disk’s manufacturer can be important for several reasons:

  • Performance Considerations: Different manufacturers produce disks with varying performance characteristics.
  • Reliability: Some brands are known for better durability and longer lifespans.
  • Warranty and Support: Knowing the disk model can help when seeking vendor support or warranty claims.

Now, let’s dive into how you can find this information using basic Linux commands.


Step-by-Step Guide to Checking Disk Manufacturer

1. Identify the Disk Using lsblk

First, you need to identify the block devices attached to your system. Use the following command to list all block devices:

lsblk

This will display a tree of block devices, which could include your main disk, partitions, and other mounted storage devices.

For example, the output might look like this:

NAME        MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
loop0         7:0    0    4G  0 loop  /home/virtfs/rightclick/var/tmp
nvme0n1     259:0    0  1.8T  0 disk  
├─nvme0n1p1 259:1    0    4G  0 part  
│ └─md0       9:0    0    4G  0 raid1 [SWAP]
├─nvme0n1p2 259:2    0    1G  0 part  
│ └─md1       9:1    0 1022M  0 raid1 /boot
└─nvme0n1p3 259:3    0  1.8T  0 part  
  └─md2       9:2    0  1.8T  0 raid1 /

In this case, the primary disk is labeled as nvme0n1.

2. Use udevadm to Get Detailed Information

Once you’ve identified the disk you’re interested in (in this case, nvme0n1), you can use udevadm to gather detailed information, including the manufacturer and model.

Run the following command, replacing nvme0n1 with the correct disk label:

udevadm info --query=all --name=/dev/nvme0n1 | grep ID_MODEL

The output might look something like this:

E: ID_MODEL=Samsung_SSD_970_EVO

This tells you that the disk is a Samsung SSD 970 EVO.

3. Directly Reading the Model File

Another quick way to check the disk model is by reading the corresponding file in the /sys directory. Use this command:

cat /sys/class/block/nvme0n1/device/model

This will display the model of your disk, similar to the result of udevadm.


Additional Methods

There are other tools and methods available if you want more comprehensive information about your disk:

Using smartctl

smartctl is part of the Smartmontools package, which allows you to retrieve a wealth of information about your storage devices, including the manufacturer and health status.

  1. Install smartmontools (if not already installed):
  • On Ubuntu/Debian: sudo apt install smartmontools
  • On RHEL/CentOS:
    bash sudo yum install smartmontools
  1. Run smartctl to check the disk information:
   sudo smartctl -i /dev/nvme0n1

This will display detailed information such as the model, serial number, firmware version, and more.

Using hdparm

hdparm is another tool for interacting with your hard drives and retrieving basic information. You can install it using:

  • On Ubuntu/Debian:
  sudo apt install hdparm
  • On RHEL/CentOS:
  sudo yum install hdparm

Then run:

sudo hdparm -I /dev/nvme0n1 | grep Model

This command should also display the manufacturer and model of your disk.


Conclusion

Checking the make and model of your disk in Linux is relatively straightforward using tools like lsblk, udevadm, and smartctl. Whether you’re managing performance, tracking hardware for inventory, or troubleshooting, knowing the manufacturer of your disks can be crucial. In this guide, we focused on NVMe disks, but the same approach works for traditional SATA and SSD drives.

Quick Recap:

  1. Use lsblk to identify your disk.
  2. Use udevadm or cat to retrieve the disk model and manufacturer.
  3. Optionally, use tools like smartctl and hdparm for more detailed information.

By following these steps, you’ll be able to easily determine the make of your disk and gain deeper insights into your hardware.


Feel free to share your experience or ask questions in the comments below!