LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-10-2009, 04:10 AM   #1
jimjones
Member
 
Registered: May 2005
Location: Belgium
Distribution: slackware 10.2
Posts: 43

Rep: Reputation: 15
harddisk check


Hi,

i currently have a few disks i want to check for overall health.
I know of the tools smartctl and badblocks. How do they compare? And if i really want to be sure which do i use?
Or is there even a more simple/quick way to do this?

JJ
 
Old 02-10-2009, 06:11 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Smartctl is an interface for the "SMART" self-diagnostic system built into most hard drives. badblocks is an external program that tests the drive for "bad blocks". Is there any reason not to use both?
 
Old 02-10-2009, 06:52 AM   #3
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
I think the simplest way to get information about the overall health of a disk is get reports from S.M.A.R.T. This technology can return status about the health of the disk and warning you about an imminent problem before it turns itself in a real problem.
It can test your disk in background and don't depends on your O.S. or even on the filesystem or partition table you have on disk.

On *nix systems, the smartd daemon can collect info about S.M.A.R.T. status and log any relevant messages to your system log. You just need to inspect this file in a regular basis using a log report tool or whatever.

badblocks on the other hand is your last resource for disk/baseboards not S.M.A.R.T. compatible. badblocks won't do anything else than listing the bad blocks it found on the disk. Is up to you to repair the file system and reserve the bad blocks from allocation and it could be tricky and risky task in some situations. It is better to backup the whole affected partition and create a new filesystem on it using the check flags (for ext2/3 it is -c) and after that, restore the backup.
 
Old 02-10-2009, 07:02 AM   #4
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
smartctl uses the built-in diagnostic capabilities of modern HD. Your HD can have a microprocessor inside it. To get a status of the disk and see if it's smart-enabled,

smartctl --all /dev/sda

Read all the output and you can find alot of data including if the disk reported any errors during operation, how many hours, how many start/stop cycles and even the current temperature. If you want to run tests you can do

smartctl -t short /dev/sda
or
smartctl -t long /dev/sda

It will tell you long the tests will run..about 2 minutes for short and 2 1/2 hours for long. It even tells you when the results will be ready! After that, do

smartctl --all /dev/sda

again and you can see the test results.

(Change /dev/sda to whatever drive you want to test)
 
Old 02-10-2009, 07:44 AM   #5
jimjones
Member
 
Registered: May 2005
Location: Belgium
Distribution: slackware 10.2
Posts: 43

Original Poster
Rep: Reputation: 15
I could use them both ofcourse.
Right now i started off with the smartmon tools - i have 1 disk reported as bad (having read errors) - and i think i might run a badblocks on that one.
My question was actually which of both should be preferred - i guess smartmon since it is the newest. Does badblocks still work on new drives (i.e. those with smart onboard) btw - is it still able to pinpoint the actual sectors on the disk that are bad?
Since i get read errors on one of the disk including a reference to dma it might as well be an electronics error as actual damage on the platters.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Check harddisk sunhui Linux - Software 2 09-21-2006 07:55 PM
Any software exist to check the health status of the harddisk? hkl8324 Linux - Software 2 03-20-2006 12:01 PM
Low Harddisk space. Can I just transfer the entire Linux to a bigger harddisk? davidas Linux - Newbie 12 04-13-2004 02:03 AM
how to check which program is currently accessing my harddisk demmylls Linux - General 1 02-10-2004 11:17 PM
Boot disk; check. CD in drive; check. Doesn't work; check. Hal DamnSmallLinux 7 02-04-2004 02:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration