LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 07-13-2005, 07:04 AM   #1
htlin
LQ Newbie
 
Registered: Jun 2005
Posts: 5

Rep: Reputation: 0
How to do low-level hard disk test?


Hello All,

Is there a way to do low-level hard disk test based on linux?

I mean, no matter what the filesystem is, the test can do something like, scan all the sectors, write/read data to/from hard disk..etc.

Thank you in advance for your response!
 
Old 07-13-2005, 07:33 AM   #2
MuLaZ
LQ Newbie
 
Registered: Aug 2004
Distribution: Slackware
Posts: 22

Rep: Reputation: 15
try fsck (man fsck and check if that's what you need)
 
Old 07-13-2005, 08:46 AM   #3
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
If you are wanting to check to see if the drive itself is still good the utility available from the manufacturer is a good choice.
The Ultimate boot CD has most of them.
http://www.ultimatebootcd.com/
 
Old 07-13-2005, 09:42 AM   #4
Lazarus
Member
 
Registered: Dec 2001
Location: Kent in UK
Distribution: Fedora 2
Posts: 170

Rep: Reputation: 30
Try the badblocks command. There is a man page for it. By default id does a non distructive read only test.
 
Old 07-13-2005, 11:18 AM   #5
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Just to expand on what 2damncommon said:

There is a S.M.A.R.T. utility that is native to Linux and should in theory work on any chipset/HDD combination which purport to support SMART. To use it you need to start the smartd daemon, and smartctl is the test utility you use to interact with the SMART tests built into the hard drive(s).

For DETAILED info on SMART:
man smartd
man smartctl
 
Old 07-13-2005, 09:54 PM   #6
htlin
LQ Newbie
 
Registered: Jun 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Many thanks to all you guys.

Your information is quite helpful to me.

However, where can I find source codes for the low-level hard disk test?
Since I would like to learn more about how the test is achieved.

Thanks again to you guys!
 
Old 07-16-2005, 04:32 PM   #7
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Well to be honest, it's the hard drives' firmware that is actually conducting the low-level test, and that information is usually proprietary. It is unlikely you will receive the source code for those tests as all the S.M.A.R.T. utilities do is request via the SMART protocol that the drives run their internal tests. To get access to the source you'd need to work for a data recovery company which has reverse-engineered the firmware or has a partnership with the manufacturers, actually work for one of the manufacturers, or reverse engineer the drives' firmware yourself from the machine language code in the chips.

It's unlikely that you would actually be able to write a portable HDD low-level testing utility without using SMART since sector addresses are abstracted and not revealed to programmers interacting with the drives anyhow; the drives' firmware actually handles the internal addressing. Any CHS specs you might see are works of fiction which only work out mathematically to a size which the drive's firmware will agree with. Why would you need that info anyhow, considering that SMART will do most if not all of what you would need?

Last edited by KimVette; 07-16-2005 at 04:34 PM.
 
  


Reply



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
Low-level formatting for hard drives totallynewguy Linux - Hardware 2 08-18-2005 08:30 AM
hard disk stress test alaios Linux - Hardware 2 05-23-2004 08:45 PM
low level languages devit Programming 2 05-07-2004 11:16 AM
Perform low level format of a floppy disk in C juby Programming 4 01-09-2003 07:47 PM
low level formatting? hyperpimp Linux - Newbie 16 04-13-2002 12:35 AM

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

All times are GMT -5. The time now is 10:31 PM.

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