Daddy Bob

DADDY BOB'S COMPUTER Q & A

 

May 21, 2006

Q. I was saving files to a USB external hard drive, and thought it was completed and pulled the plug. Now there is a corrupt file that I cannot delete, open, rename, etc. What happened, and how can I delete this bad file?

A. It appears that you have been victimized by a feature called "Delay Write". Most hard drives use something called "Hard Drive Caching". There are both read and write caching, and for this answer, we are only concerned with the write caching. Here is an excerpt from my article on this subject that can be read HERE.

"When write caching is enabled, (which it always is by default) and the system sends a write to the hard disk, the logic circuit in the hard drive stores the data in its much faster cache memory, and then immediately sends back an acknowledgement to the operating system saying, "all done!" The rest of the system can then proceed on its other business without having to sit around waiting for the hard drive to position the read/write arm, the disk to spin, and so on. This is called write-back caching, because the data is stored in the cache and only "written back" to the drive later on.

Write-back functionality of course improves performance. There's a catch however. The drive tells a little white lie when it sends back "all done" because it really isn’t. The data isn't on the disk at all, it's only in the cache. The hard disk's logic circuits begin to write the data to the disk, but of course this takes some time. It is sort of the old “The checks in the mail” routine."

Apparently, you thought the writing to the USB external drive was finished, because the computer said it was, but the write back cache had not completely written the data. When you "pulled the plug", some data was left in never-never land between the cache and the hard drive and was lost. The file was not written correctly, and thus became corrupt.

To prevent this from happening in the future, always wait until there is no disk activity before disconnecting the USB external hard drive from the computer, or unplugging it, or turning it off. This can also happen to a floppy or any other storage device, but floppies are all but obsolete, and most other drives have faster write times so are less susceptible.

Now, how to get rid of this corrupt file that you cannot delete. Fortunately, Windows has a built in method to fix this situation. It is called "chkdsk". In versions other than NT, 2000, or XP it is called "scandisk". To run this utility, open My Computer, and right click on the drive containing the corrupt file. Choose Properties, then the Tools tab. Click the "Check Now" button, and check both boxes and click Start.

Scandisk may not be able to run until you reboot the computer, and if this is the case, allow it to reboot. When it does, and before Windows starts up, chkdsk will run. This process can take a long time, depending on the size of the drive being checked, and how much there is on it. When it completes, the computer will reboot, and the corrupt file will (should) be gone.

As mentioned, for a complete understanding of disk caching and delay writing, read my article on the subject HERE.

 

Click HERE to view or download as a Microsoft Word document

Disclaimer:

The materials in this site are provided "as is" and without warranties of any kind, either express or implied. To the fullest extent permissible pursuant to applicable law, I disclaim all warranties, express or implied, including, but not limited to, implied warranties of merchantability and fitness for a particular purpose. I do not warrant that the functions contained in the materials on this site will be uninterrupted or error-free, that defects will be corrected, or that any site or the servers that make such materials available are free of viruses, spyware, adware, or other harmful components, although all efforts have been made to assure that they are. I do not warrant or make any representations regarding the use or the results of the use of the materials on this site in terms of their correctness, accuracy, reliability, or otherwise. You assume the entire cost of all necessary servicing, repair, or correction. Applicable law may not allow the exclusion of implied warranties, so the above exclusion may not apply to you.