HDD Diagnostic Application

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello to all,

I m a beginner in the Linux platform. Since last two years,i was
working on Embedded C,C++ on the keil compiler, on the 89C51RD2. I have
also worked on the WinCE 5.0 Platform Builder with EVC++.
According to my new project, i would like to write the diagnostic
application for the PC type device (32 bit processor) i.e i have to
test the functionality of each and every hardware like CPU,HDD,Serial
Ports,RAID,etc.The client has given the procedure to carry out each
As per the requirement the procedure to test HDD should be

# Check HDD

1.  Validates the hard-disk device by writing a pattern onto an unused
sector and compares  with the expected pattern.

2.  Checks all the sectors (HDD surface test) and report bad sectors.

3.  Retains the original sector contents.

Can anyone please help me to start the application.

Please guide me...

Thanks and Regards,

Re: HDD Diagnostic Application

Quoted text here. Click to load it
You are aware that this behaviour is almost entirely meaningless for IDE
devices ?

Quoted text here. Click to load it

See dd and errorlevel - you can write this in bash script, but its a bit
pointless. Once a modern drive flags a bad sector (which it will do when
written to) its a bin job, the internal software on the drives remaps bad
sectors on the fly so once one shows through its game over.

To test an IDE disk simply write to all sectors within the volume and if
you hit an error bin it - true for most newer SCSI drives as well. You can
write patterns if you like, it will just take much longer to fail in the
same place !

# dd if=/dev/zero of=/dev/hda

or for the more "patterny" version

# dd if=/dev/random of=/dev/hda

Have you calculated how long all patterns within a sector for a 250GB disk
would take ?


Re: HDD Diagnostic Application

Quoted text here. Click to load it

Thanks a lot Jon!!!

I know it is ime cosuming, but it is one of the requirement of the
project :)

Can u tell me how to write the dd command in the C programming??
Actually i have to write the C program or the HDD test without using
shell scriping.

Please guide me!!

Thanks & Reagards,

Site Timeline