Daniel da Costa Jotha <[EMAIL PROTECTED]> [2002-08-16 01:43:47 -0300]: > The problem is: > I have a 1.44MB floppy disk that has the 2817th sector bad and its > 2816th sector isn't bad; when I try to read this sector with the > command: > # dd if=/dev/fd0h1440 of=/dev/null bs=512 skip=2816 count=1 > , it gets an io error. I think it's because dd or the C Library gets > 1024 bytes instead of 512 bytes at a time from the device.
The dd program is eventually calling read() and write() which are part of the os kernel, beyond even the C library. > The badblocks program, which is not part of fileutils package, has the > same behavior with -b 512, an option that takes 512 bytes per block. Especially since both programs are saying similar things, this looks like a bad floppy. You know that. But apparently are concerned with how the program is operating in the presence of bad media. I am not sure there is anything that dd could do differently. It can only work with the information that the kernel provides. > I tested to cp a file that is using this sector from the mounted > diskette (an operation that uses kernel filesystem drivers, which ones > don't use glibc), and I don't encounter any problem. Actually glibc will call the kernel read and write routines as part of normal glibc operation. You can't get away from the kernel. Whether you use the kernel filesystem or just read and write the data in raw format is a different issue. The dd program just reads and writes raw data. > If there isn't information enough, or if my Brazilian English wasn't > very clear, please tell me. You English is very good, better than many native speakers. No apologies are needed. Bob _______________________________________________ Bug-fileutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-fileutils