How to see disk details like manufacturer in Linux

176,396

Solution 1

Try these commands:

lshw -class disk  

hwinfo --disk

You may have to install hwinfo.

Concerning hdparm:
hdparm(8) says:

Although this utility is intended primarily for use with SATA/IDE hard disk 
devices, several of the options are also valid (and permitted) for use with 
SCSI hard disk devices and MFM/RLL hard disks with XT interfaces.

and:

Some options (eg. -r for SCSI) may not work with old kernels as necessary 
ioctl()´s were not supported.

Solution 2

You could read the disk properties directly through sysfs, also check the other files/dirs in /sys/class/block/sda/device/ (replace sda with drive you need).

cat /sys/class/block/sda/device/{model,vendor} 

Solution 3

try running smartctl -a /dev/hda (could be sda in your case; cat /proc/partitions will show you the device type to use)

In your case it's behind a cciss controller, so the option should be -d cciss,0 or similar.

Solution 4

lsblk (List Block)

You can use lsblk command:

$ lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL

NAME        FSTYPE LABEL   MOUNTPOINT                      SIZE MODEL
...
nvme0n1                                                  119.2G TS128GMTE110S                           
├─nvme0n1p1 vfat           /boot/efi                       512M 
└─nvme0n1p2 ext4           /                             118.8G 

Perfectly informed, my NVMe SSD is a Transced 110S 128GB (TS128GMTE110S)

Solution 5

I know these answers are 3 years old, but for anyone looking around... In older versions you could find that under (? should be a number):

/sys/class/scsi_device/?:?:?:?/device/model

by doing this:

cat /sys/class/scsi_device/0\:0\:0\:0/device/{model,vendor}

(The backslashes next to zeros are for escaping special char :.)

Share:
176,396

Related videos on Youtube

Michael Mrozek
Author by

Michael Mrozek

Updated on September 17, 2022

Comments

  • Michael Mrozek
    Michael Mrozek almost 2 years

    With sfdisk -s I can see the disk capacity as follows:

    $ sfdisk -s
    /dev/cciss/c0d0: 143338560
    total: 143338560 blocks
    

    How do I see disk details like disk manufacturer? I tried hdparm, but got an error:

    $ hdparm -i  /dev/cciss/c0d0
    /dev/cciss/c0d0:
    HDIO_GET_IDENTITY failed: Inappropriate ioctl for device
    
  • Admin
    Admin over 13 years
    I dont have block directory
  • Admin
    Admin over 13 years
    the command hwinfo & lshw are not installed in my linux
  • OneOfOne
    OneOfOne over 13 years
    Use a recent kernel maybe, what distro are you using? try dmesg | less, should see the disks get probed.
  • wag
    wag over 13 years
    can you provide some more information about your system?
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' over 13 years
    @jennifer: Install at least one of them! All the information they return is available elsewhere, but they have the advantage of collecting all that information from many different places.
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' over 13 years
    @jennifer: cat /sys/block/sd?/device/{model,vendor} (/sys/class/block only appeared fairly recently, and your distribution is a little old).
  • slm
    slm almost 10 years
    Can you provide some sample output or an explanation of where to find this tool? It's not available in my Fedora 20 system, for example.
  • Anthon
    Anthon almost 10 years
    @slm That is part of the fibreutils package that originates/d from HP.
  • slm
    slm almost 10 years
    @Anthon - so then it's not a standard linux package?
  • Anthon
    Anthon almost 10 years
    @slm correction, I have the source for scsi_info, comes with the RPM. Just not compiled/installed.
  • slm
    slm almost 10 years
    @Anthon - I just searched the F20 repos that I have access to for lssd & scsi_info and neither returned a hit. Here lssd is mentioned w/ fibreutils as you described: ftp.hp.com/pub/softlib2/software1/doc/p603757071/v60944/…
  • Anthon
    Anthon almost 10 years
    @slm I didn't install the original system, just found & used the util (I have an unused fibrechannel board somewhere). filewatcher.com/m/fibreutils-2.5-4.x86_64.rpm.56725-0.html
  • slm
    slm almost 10 years
    I'm thinking this Q is missing a tag. I'm not that familiar with fibrechannel, seems like it's related to that.
  • oHo
    oHo over 8 years
    Running the command lshw -class disk as a regular user does not display information on disk (Ubuntu 15.04). Hopefully the bottom printed line says "WARNING: output may be incomplete or inaccurate, you should run this program as super-user." Running again using sudo fixes the issue :-)
  • geruetzel
    geruetzel over 7 years
    this is a command specific to hp raid controllers - so it is not useful here
  • Ciro Santilli Путлер Капут 六四事
    Ciro Santilli Путлер Капут 六四事 over 5 years
    I wonder why lshw simply did not show my SSD: unix.stackexchange.com/questions/5085/…
  • telcoM
    telcoM about 5 years
    The name /dev/cciss/c0d0 indicates the OP's system uses a HP SmartArray hardware RAID controller, and so any "disk" shown by it is actually a RAID set, which may or may not correspond directly to any single physical disk. In that specific situation, you'll need a tool that knows how to talk to the RAID controller and get the information on actual physical drives from it. hwinfo, lshw or smartctl mentioned in other answers all understand some types of hardware RAID controllers; a vendor-specific RAID management tool will usually get the most information.
  • Pound Hash
    Pound Hash over 2 years
    lshw didn't show the manufacturer for me, but hwinfo did.