NTFS problem on 8.1
I've come across a problem while helping out a customer. I'm trying to recover most of a vital email file from an IBM Travelstar that's broken. It's reporting "sector not found" just over 100Mb into the file. The plan was to read all the accessible sectors and write them out to a new disk. I have a C program that will do this, using lseek() and read() to get each block in turn, skipping the blocks that return an error. The trouble is, the kernel never returns when it hits the bad sector. The machine's not in front of me at present, but what I'm seeing in /var/log/messages is four or five times it logs the "sector not found", then it resets the drive, then it tries again. Because it's stuck in the kernel I can't kill the calling process even with -9. It's not just my program, because it does the same when using the cp command. 1. Is this a bug in ntfs support? 2. Whether it is or not, is there anything I can tweak to make the kernel return an error to the calling program instead of looping for ever when it hits the bad sector? Thanks in advance for any help. -- Peter Davey psvdavey.nospam@tiscali.co.uk (really)
On Wed, 7 May 2003, Peter Davey wrote:
I've come across a problem while helping out a customer.
I'm trying to recover most of a vital email file from an IBM Travelstar that's broken. It's reporting "sector not found" just over 100Mb into the file. The plan was to read all the accessible sectors and write them out to a new disk. I have a C program that will do this, using lseek() and read() to get each block in turn, skipping the blocks that return an error.
The trouble is, the kernel never returns when it hits the bad sector. The machine's not in front of me at present, but what I'm seeing in /var/log/messages is four or five times it logs the "sector not found", then it resets the drive, then it tries again. Because it's stuck in the kernel I can't kill the calling process even with -9. It's not just my program, because it does the same when using the cp command.
1. Is this a bug in ntfs support?
It's possible. SuSE includes the old, unmaintained NTFS driver.
2. Whether it is or not, is there anything I can tweak to make the kernel return an error to the calling program instead of looping for ever when it hits the bad sector?
1) Patch/recompile the kernel with the new, rewritten NTFS driver (many distros use that one) from http://linux-ntfs.sf.net and try with that. 2) Try 'dd' the partition with the 'noerror' option then loopback mount the image and read that one. Szaka
participants (2)
-
Peter Davey
-
Szakacsits Szabolcs