1

I am being told I have a failing hard drive but no one can tell me which one. I have 2-146GB drives and 4-1TB drives. Accoring to my list I only see 2 of the actual drives? How can I get a list of the actual drives? How can I figure out which is bad? If I check in the HP ILO Storage it shows all disks are ok?

# lsblk -d
NAME  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0   7:0    0  60.6M  1 loop /usr/portage
sda     8:0    0 136.7G  0 disk
sdb     8:16   0   1.8T  0 disk
zd0   230:0    0     2G  0 disk [SP]
zd16  230:16   0   1.8T  0 disk
zd32  230:32   0     3G  1 disk

Linux is Gentoo

3
  • 1
    I posit you are running zfs and the zd* block devices are zvols. What does "sudo zpool status" say?
    – davidgo
    Commented Oct 25, 2020 at 4:33
  • I normally use lsscsi to list things. It looks like lsblk has a -a option which shows empty drives. Depending on how it is failing, maybe that would show some other drives? Once you identify the failing drive, you can use hdparm -i /dev/sda to get it to print out the serial, etc., which hopefully corresponds to stuff printed on a physical label on the drive.
    – binki
    Commented Oct 25, 2020 at 4:45
  • Try cat /var/log/syslog | grep kernel | grep '/dev/sd\|/dev/zd' to filter for any error messages being reported by disks. You say you are being told you have failing disks; by who or what? If it is unable to tell you which disk and why, it isn't exactly a reliable source.
    – paddywan
    Commented Oct 25, 2020 at 5:47

1 Answer 1

0

The result here is rather technical, so beware...

Copy this text into a file, say $HOME/smartstat

#!/bin/bash
b="----------------" # 16 dashes
lsblk -p \
| grep disk \
| cut -d' ' -f1 \
| while read disk ;do 
    echo -e "\n$(tput rev)$b\n ${b: -2} $disk ${b: -2} \n$b$(tput sgr0)"
    sudo smartctl -a $disk
  done

Then do: chmod 755 smartstat (in Terminal, at the bash prompt) to set it as being an executable. After that ./smartstat will run it... providing a wealth of information for each "disk" that lsblk recognizes (append | less to use the text reader, instead of relying on terminal scrollback).

A disk/drive that has "SMART" tech embedded MIGHT show something that tells IF or even WHAT problems there exists in that drive - but there is a lot to read and ponder on.
You might need to read up on how to interpret all those numbers.

I have yet to see the output from a failed drive, so cannot advice about that.
Maybe others can fill in regarding it.

These may be helpful:
https://www.linuxjournal.com/article/6983?page=0%2C1
https://en.wikipedia.org/wiki/S.M.A.R.T.#Known_ATA_S.M.A.R.T._attributes
https://www.smartmontools.org/wiki/FAQ
https://serverfault.com/questions/419007/understanding-smartctl-a-output

info:
smartctl is part of smartmontools, for ubuntu, can't tell for other distro's

1
  • removed the comment.
    – Hannu
    Commented Nov 21, 2020 at 17:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .