Show disk info linux

How to see disk details like manufacturer in Linux

@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.

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 🙂

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.

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/

Use a recent kernel maybe, what distro are you using? try dmesg | less , should see the disks get probed.

@jennifer: cat /sys/block/sd?/device/ ( /sys/class/block only appeared fairly recently, and your distribution is a little old).

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

Читайте также:  Linux mint язык ввода

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

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)

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 
cat /sys/class/scsi_device/0\:0\:0\:0/device/

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

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 

Источник

Читайте также:  Отобразить скрытые папки linux

Is there a command to view hard drive specs

I noticed that my Ubuntu is lagging EXTREMELY badly but only the first time I do things after what I did gets loaded into RAM the lag stops totally. I ran some tests and I guess one of my laptop hard drives is borked. Im assuming that I have to replace the drive, is there some command I can issue to see the exact specs on the drive so I can then buy it online? I don’t want to have to open up the laptop, find the specs. Then open it again when the new drive arrives.

Or is there another cool hacky command or way to partition my drive to avoid using the bad spots? A while ago when my drive failed I mounted it useing an alternative superblock and this worked and still does i guess..

I found the hacky solution I wanted. I ran the command «badblocks /dev/sda1» and then noticed they were all near the front of the drive. So I created an unallocated partition at the front of the drive consisting of 50% of the total size. I then tested the second half of the drive! AND WALAAAAAAAA. IT WORKED. Im going to buy a new drive anyway but this process taught me alot 🙂

5 Answers 5

smartctl command from smartmontools package is what you want for that

% sudo smartctl -i /dev/sda smartctl 6.2 2013-07-26 r3841 [i686-linux-3.13.0-24-generic] (local build) Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Family: SAMSUNG SpinPoint M7 Device Model: SAMSUNG HM250HI Serial Number: LU WWN Device Id: 5 0024e9 203520f1d Firmware Version: 2AC101C4 User Capacity: 250,059,350,016 bytes [250 GB] Sector Size: 512 bytes logical/physical Device is: In smartctl database [for details use: -P show] ATA Version is: ATA8-ACS T13/1699-D revision 6 SATA Version is: SATA 2.6, 3.0 Gb/s Local Time is: Thu May 15 21:49:09 2014 MYT SMART support is: Available - device has SMART capability. SMART support is: Enabled 
lshw -class disk -class storage 

Thanks I hope this helps someone but the first answer was PERFECT so im not even bothering with this, do you know if I can somehow use only part of my hard drive? The hole thing still works but super slow. I know nothing of hardware but maybe there is a way to say only use the good part of the hard drive? Maybe when hard drives go bad only certain portions go bad?

% sudo hdparm -I /dev/sda ~ /dev/sda: ATA device, with non-removable media Model Number: WDC WD10JPCX-24UE4T0 Serial Number: WD-WXR1E24A7U0E Firmware Revision: 01.01A01 Transport: Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0 Standards: Supported: 9 8 7 6 5 Likely used: 9 Configuration: Logical max current cylinders 16383 16383 heads 16 16 sectors/track 63 63 -- CHS current addressable sectors: 16514064 LBA user addressable sectors: 268435455 LBA48 user addressable sectors: 1953525168 Logical Sector size: 512 bytes Physical Sector size: 4096 bytes Logical Sector-0 offset: 0 bytes device size with M = 1024*1024: 953869 MBytes device size with M = 1000*1000: 1000204 MBytes (1000 GB) cache/buffer size = 16384 KBytes Nominal Media Rotation Rate: 5400 

You can use lsblk, it has a ton of options that you can use e.g.:

Читайте также:  Установка времени линукс терминал

which gives this result in my case

MODEL SIZE NAME Samsung SSD 850 232.9G sda Samsung SSD 850 931.5G sdb 

Источник

Оцените статью
Adblock
detector