Skip navigation.
Home
The QNX Community Portal

View topic - check disk for bad sectors from an application

check disk for bad sectors from an application

For discussion of realtime and/or embedded programming.

check disk for bad sectors from an application

Postby rahil » Tue Dec 07, 2010 7:58 am

Hi,

I need to check my disk for bad sectors irrespective of the filesystem on it. I can use dcheck from the command line and want to avoid using system/spawn APIs from my application.

If there is any alternative to system/spawn APIs, ps let me know.
rahil
Active Member
 
Posts: 75
Joined: Wed Feb 11, 2009 12:13 pm
Location: India

RE: check disk for bad sectors from an application

Postby mario » Tue Dec 07, 2010 3:25 pm

no there isn't any API for that. You'll have to start dcheck from within your application with system or popen
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: check disk for bad sectors from an application

Postby maschoen » Tue Dec 07, 2010 9:10 pm

Well you could use open on /dev/hd# and try reading each sector. There's a read routine with the word "block" in the name that will get you around the 2Gig file limit.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 1 guest

cron