Skip to main content
added 56 characters in body
Source Link
Hannu
  • 9.5k
  • 3
  • 23
  • 42

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

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://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

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

deleted 35 characters in body
Source Link
Hannu
  • 9.5k
  • 3
  • 23
  • 42

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 \  # single space between the quotes
| 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://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

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 \  # single space between the quotes
| 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://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

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://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

added 34 characters in body
Source Link
Hannu
  • 9.5k
  • 3
  • 23
  • 42

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 \  # single space between the quotes
| 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://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

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 \  # single space between the quotes
| 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 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://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

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 \  # single space between the quotes
| 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://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

added 87 characters in body
Source Link
Hannu
  • 9.5k
  • 3
  • 23
  • 42
Loading
edited body
Source Link
Hannu
  • 9.5k
  • 3
  • 23
  • 42
Loading
added 221 characters in body
Source Link
Hannu
  • 9.5k
  • 3
  • 23
  • 42
Loading
added 221 characters in body
Source Link
Hannu
  • 9.5k
  • 3
  • 23
  • 42
Loading
Source Link
Hannu
  • 9.5k
  • 3
  • 23
  • 42
Loading