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.