write() issue during a low level hdd access


 
Thread Tools Search this Thread
Top Forums Programming write() issue during a low level hdd access
# 29  
Old 02-24-2010
Wow, I'm glad that worked! Smilie Since I was completely out of ideas... Smilie
# 30  
Old 03-02-2010
PHP

Updates!! Smilie

Unfortunately, even the SG_IO method of sending write command (technically they are SAT commands, though the core is ATA commands) could not be failed for a bad sector.

I have confirmed the bad sector presence with the help of MHDD, Winhex and HDDSCAN utilities, but the linux program is unable to identify them as bad and the write passes through without any issues.

I even tried the sg_dd command from sg3-utils package which does the same write method as what I have attempted and even that fails to identify the bad sectors. (with or without direct io enabled at /proc/scsi/sg/allow_dio).

I have tried sgio, dio, dsync, fsync and almost all the combinations of multiple blocks per transfer ranging from a single sector to 512 sectors. (1, 8, 16,32,64, 128, 256 and 512 sectors per transfer). None could identify the bad sectors.

I am completly out of options unless if somebody could direct me else where!! Smilie Smilie Smilie

Testing takes a LOT of time even for a smaller HDD (20 GB). Smilie

My sincere thanks to Corona688 and fpmurphy for all their valuble comments, critics and suggestions!
# 31  
Old 03-02-2010
Why are you doing writes to a dying drive? Try reads.

Furthermore you must know about sector remapping.

Nothing left but to talk to the drive raw with ATA commands. You want raw I/O, do raw I/O. Not portable, what you're asking for just isn't.
# 32  
Old 03-02-2010
My requirement is simple.

I want to zero fill a drive before I do "something" to it.

I want to know how many bad sectors on it as my decision of doing "something" is dependent on it.

That's all. I wanted to do in Linux and I am unable to do it with whatever

I could get it in DOS / WINDOWS, but not in Linux.

"Something" translates to destroying / reusing it.

Reading alone will not suffice as even read fails to identify bad sectors correctly.

I know about sector remapping and the triggering mechanism for a bad sector too.

Thanks.
# 33  
Old 03-03-2010
Quote:
Originally Posted by sponnusa
I want to zero fill a drive before I do "something" to it.
Well that's new. Thanks for telling.
Quote:
I wanted to do in Linux and I am unable to do it with whatever. I could get it in DOS / WINDOWS, but not in Linux.
According to earlier conversation you couldn't get it in windows without a custom device driver. which brings me back to my earlier suggestion of the linux kernel mailing list. If you haven't contacted them earlier, now would be a great time, as this thread's done a great job of rattling out what your requirements are.
# 34  
Old 03-03-2010
Quote:
Originally Posted by Corona688
Well that's new. Thanks for telling. According to earlier conversation you couldn't get it in windows without a custom device driver. which brings me back to my earlier suggestion of the linux kernel mailing list. If you haven't contacted them earlier, now would be a great time, as this thread's done a great job of rattling out what your requirements are.
I guess, we are debating on what I wrote on this thread rather. I had mentioned that I wanted to zero fill a drive in my first post.

Let's not go over into frenzy again! Smilie

I am able to do it on Windows or in DOS without any special device drivers. If I want to send commands to the hardware directly, I am able to send commands to the hardware directly. It works fine in Windows and in DOS (Well, I quote DOS for historical reasons as the initial erasure program was developed in DOS about 14 years ago!).

The last try I had with Linux was with the SG_IO commands (I believe that is the method of sending RAW ATA COMMANDS to the drive) and that did not work too. The command, say sg_dd is unable to identify the bad blocks / sectors on the hdd during the write process (on a drive which has failed with Windows, DOS and another Windows based disk erasure applications).

I guess, I am clear now, if not please let me know.
# 35  
Old 03-04-2010
Quote:
I am able to do it on Windows or in DOS without any special device drivers. If I want to send commands to the hardware directly, I am able to send commands to the hardware directly. It works fine in Windows and in DOS (Well, I quote DOS for historical reasons as the initial erasure program was developed in DOS about 14 years ago!).
What APIs are you using to do this in Windows?
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Programming

Low level X11 programming

How to use X11 without Xlib not XCB? How draw window directly on low level? I must use anyway window manager like Motif? I have ridden that X11 has server-client architecture, client send via TCP/IP to port 6000 request for primitives and get replies. Where is detailed description of it? In X11... (0 Replies)
Discussion started by: AndrzejB
0 Replies

2. Programming

Why is C/C++ considered low-level languages???

Hi friends, I hope everyone is doing well and fine. I have always been hearing that C/C++ are relatively low-level as compared to Java/C# etc. Could you please tell me some low-level qualities of C/C++? And I think disk deframenters are written in C/C++, please correct me if I am wrong. And please... (5 Replies)
Discussion started by: gabam
5 Replies

3. Programming

System calls and C language low-level qualities???

Hi friends, I hope everyone is fine and doing well. I queried in my previous thread about the low-level qualities of C/C++ languages.I really thank you people for explaining, it was really helpful. One more ambiquity that I have in my mind is regarding the unix system calls like open, creat,... (1 Reply)
Discussion started by: gabam
1 Replies

4. AIX

High Runqueue (R) LOW CPU LOW I/O Low Network Low memory usage

Hello All I have a system running AIX 61 shared uncapped partition (with 11 physical processors, 24 Virtual 72GB of Memory) . The output from NMON, vmstat show a high run queue (60+) for continous periods of time intervals, but NO paging, relatively low I/o (6000) , CPU % is 40, Low network.... (9 Replies)
Discussion started by: IL-Malti
9 Replies

5. IP Networking

Best reference for understanding low level info on nic cards drivers and functionality

Hi, What is the best reference that gives in detail on nic cards configuration , assigning multiple ip addresses to a single interface, netlink library etc and all basic stuff at this level..? Thanks (2 Replies)
Discussion started by: Gopi Krishna P
2 Replies

6. HP-UX

Access to a second HDD

Hello How to access to a second hard disk on a HP-UX system? Thanks (3 Replies)
Discussion started by: ouniss
3 Replies

7. UNIX for Dummies Questions & Answers

Low level format?

I want to do a low level format like in windows (C:\format c:) but I don't know how it works in unix or linux.. Can somebody help me ? thnx :) (3 Replies)
Discussion started by: day
3 Replies
Login or Register to Ask a Question