99

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
Michael Mrozek
  • 93,103
  • 40
  • 240
  • 233

9 Answers9

105

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.
wag
  • 35,944
  • 12
  • 67
  • 51
  • the command hwinfo & lshw are not installed in my linux –  Dec 22 '10 at 13:36
  • can you provide some more information about your system? – wag Dec 22 '10 at 17:07
  • @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' Dec 22 '10 at 19:50
  • 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 :-) – oHo Oct 20 '15 at 21:13
  • I wonder why lshw simply did not show my SSD: https://unix.stackexchange.com/questions/5085/how-to-see-disk-details-like-manufacturer-in-linux/490819#490819 – Ciro Santilli OurBigBook.com Dec 24 '18 at 23:15
  • 1
    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. – telcoM May 07 '19 at 04:44
  • lshw didn't show the manufacturer for me, but hwinfo did. – Pound Hash Dec 21 '21 at 00:23
68

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} 
OneOfOne
  • 1,394
23

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)

  • 1
    +1 This provides nice output and does not require root access! – EM0 Feb 06 '23 at 10:42
  • 1
    You can add the model name to the default output of lsblk with lsblk -o +model, that's even easier! – marcelm Sep 04 '23 at 17:12
  • This is a nice tip, and I almost updated the answer. But I realize that the default output also misses other fields and, for informational purposes, I suggest to leave the answer as it is. – Paulo Coghi Sep 05 '23 at 07:01
18

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.

Michael Mrozek
  • 93,103
  • 40
  • 240
  • 233
9

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 :.)

Kazark
  • 979
  • 3
  • 12
  • 31
lito15
  • 91
5

lsblk (List blocks) gives a list with device, size, type and mount_point

sudo lsblk 
NAME                   MAJ:MIN RM    SIZE RO TYPE MOUNTPOINT
sda                      8:0    0  465.8G  0 disk 
└─sda1                   8:1    0  465.8G  0 part /data
sdb                      8:16   0    1.8T  0 disk 
├─sdb1                   8:17   0 1002.3G  0 part 
│ └─lvmvolumeSda6-home 254:0    0    2.8T  0 lvm  /home
└─sdb2                   8:18   0  860.7G  0 part 
sdc                      8:32   0  232.9G  0 disk 
└─sdc1                   8:33   0  232.9G  0 part 
sdd                      8:48   1    3.7T  0 disk 
└─sdd1                   8:49   1    3.7T  0 part /mnt/backups
sde                      8:64   1    1.8T  0 disk 
├─sde1                   8:65   1  864.5G  0 part 
│ └─lvmvolumeSda6-home 254:0    0    2.8T  0 lvm  /home
└─sde2                   8:66   1  998.6G  0 part 
  └─lvmvolumeSda6-home 254:0    0    2.8T  0 lvm  /home
sr0                     11:0    1   1024M  0 rom  
sr1                     11:1    1   1024M  0 rom  
nvme0n1                259:0    0  465.8G  0 disk 
├─nvme0n1p1            259:1    0  134.8G  0 part 
├─nvme0n1p2            259:2    0    1.9G  0 part /boot
├─nvme0n1p3            259:3    0      1K  0 part 
├─nvme0n1p4            259:4    0     87G  0 part /
├─nvme0n1p5            259:5    0     15G  0 part [SWAP]
└─nvme0n1p6            259:6    0  227.2G  0 part /data_nvme

lsblk -S gives model, vendor, etc...

sudo lsblk -S
NAME HCTL       TYPE VENDOR   MODEL             REV TRAN
sda  0:0:0:0    disk ATA      WDC WDS500G1B0A- 10WD sata
sdb  1:0:0:0    disk ATA      WDC WD20EFRX-68E 0A82 sata
sdc  5:0:0:0    disk ATA      Samsung SSD 850  1B6Q sata
sdd  10:0:0:0   disk ATA      WDC WD40EFRX-68W 0A82 sata
sde  11:1:0:0   disk ATA      WDC WD20EARS-00M AB51 sata
sr0  9:0:0:0    rom  ASUS     BC-12D2HT        1.00 sata
sr1  11:0:0:0   rom  TSSTcorp CDDVDW SH-222BB  SB00 sata
fra-san
  • 10,205
  • 2
  • 22
  • 43
3

gnome-disks

Either gnome-disks or just "Disks" on the Ubuntu 18.10 dash:

enter image description here

This shows that I have a SAMSUNG MZVLB512HAJQ-000L7 in my Lenovo ThinkPad P51.

TODO why: for some reason, my SSD model was not showing clearly on either of:

sudo lshw -class disk
sudo hwinfo --disk
  • lshw did not how the SSD at all, only my hard disk

  • hwinfo did show both, but for the SSD said just:

    Model: "Samsung Electronics Disk"
    

    while for the HD it contains the actual model...

    Model: "ST1000LM035-1RK1"
    

This one from https://unix.stackexchange.com/a/5087/32558 worked though:

cat /sys/block/nvme0n1/device/model
Ciro Santilli OurBigBook.com
  • 18,092
  • 4
  • 117
  • 102
-2

Try this command as root user.

hpacucli ctrl all show config detail
Ramesh
  • 39,297
-2

The lssd command can also help you.

slm
  • 369,824
  • 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. – slm Sep 09 '14 at 02:09
  • @slm That is part of the fibreutils package that originates/d from HP. – Anthon Sep 09 '14 at 03:18
  • @Anthon - so then it's not a standard linux package? – slm Sep 09 '14 at 03:25
  • @slm I'm pretty sure I have it from the RedHat machines I used to have access to. It is a bash script, but I haven't used it for many years. It calls scsi_info which I don't have on my Ubuntu system at all. – Anthon Sep 09 '14 at 03:32
  • @slm correction, I have the source for scsi_info, comes with the RPM. Just not compiled/installed. – Anthon Sep 09 '14 at 03:34
  • @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://ftp.hp.com/pub/softlib2/software1/doc/p603757071/v60944/psp-8.41.rhel5.linux.txt – slm Sep 09 '14 at 03:43
  • @slm I didn't install the original system, just found & used the util (I have an unused fibrechannel board somewhere). http://www.filewatcher.com/m/fibreutils-2.5-4.x86_64.rpm.56725-0.html – Anthon Sep 09 '14 at 03:50
  • I'm thinking this Q is missing a tag. I'm not that familiar with fibrechannel, seems like it's related to that. – slm Sep 09 '14 at 03:51