You need to know about disk write caching – trust me
Take care when removing your external drives. This applies to USB and firewire external drives, to flash cards and to flash drives – otherwise known as pen drives, thumb drives or memory sticks.
If you don't follow the rules, one of these frosty Fridays your supposedly safely backed up data will be toast.
Yeah? Why?
OK, this is mildly complicated. When Windows, or any other operating system, writes stuff onto your storage drives – HDDs, CD-R or flash drives for instance – there's a hurdle to jump.
Your computer can process data at speeds which are orders of magnitude faster than the rate at which it can write data to your disks. If Windows sat around and waited for those data to be written, your fancy new 4GHz processor and would be spinning its quad-core wheels and your computer would slow to a crawl until writing was completed.
"The cheque's in the mail"
Clever techie folk solved this problem a long time ago by introducing "write caching". The principle is quite simple: you disconnect the fast computer from the slow disk writing process. Instead of writing the data directly to disk in real time, the information is sent to temporary storage in a fast memory cache, the cache then reports back to Windows that the data has been written. It's the IT equivalent of "the cheque's in the mail".
You and your computer can get back to playing Space Invaders and writing the great 21st Century novel. Unfortunately however, just like the mythical cheque, the data have quite possibly not arrived at their intended destination. Windows just thinks they have. Under the hood the data are still sitting in the cache waiting for a quiet moment to be written to the target drive.
"OK, So what?" I hear you cry
If the postman steps on a landmine, even if the cheque had been in the mail it would be dog tucker. Same with your cached data. If your PC is in the process of writing stuff (which it often does, whether you initiated it or not) and:
- you remove a flash drive from its USB socket or
- you turn off or disconnect an external hard disk or CD-R drive or
- you have a power cut and you don't have a UPS (uninterruptable power supply) or – even worse
- you turn off your PC without shutting down Windows first,
then you run a significant risk of data corruption because file writing has not been finalised.
If this happens you will probably trash the data and possibly your external disk or, if it's an operating system file being written to, you can even corrupt your Windows installation.
Oh dear, that's a bit of a worry
Too right it is. But never fear, you can protect yourself.
- Don't turn off your PC without closing down the operating system first. In the case of Windows XP follow the usual routine to shut down, hibernate or sleep. Never, repeat never, turn off power to your PC before the machine has shut itself down.
Hot tip XP shortcut: Windows key + U + U to shut down, Windows key + U + H to hibernate, Windows key + U + S to sleep.
Write caching is not the only reason for not turning off your PC properly. Your hard drive can get cluttered up with all kinds of junk temporary files which Windows would normally delete during the shutdown process. Don't do it! - Don't turn off the power to your PC when it's in Sleep mode. (It's OK in Hibernate mode).
- Right click on the icon in the notification area to the right of your taskbar to "safely remove" an external drive before removing it from its socket, turning it off, or removing its connecting cable from its socket.
- To be 100% safe you should also do this before your computer goes into hibernation or sleep mode if you intend subsequently to remove the device.

- The icon shown in the first image at right is a Vista notification area. The XP icon shown in the lower image on the left is a little different.
- To be 100% safe you should also do this before your computer goes into hibernation or sleep mode if you intend subsequently to remove the device.
- Get a UPS (uninterruptable power supply) – plug your PC, your monitor and your powered external drive
into it (i.e. if it has its own power supply separate from the USB port).
- In the event of power failure the UPS's battery will keep your hardware running while you or the USB's bundled software save your data and shut down the PC properly.
- As a bonus the UPS will provide additional protection to your PC and connected devices in the event of power spikes and lighting strikes.
- You can change the properties of individual external drives to disable write-caching. Then you may remove or turn off the device without going the "Safely Remove Hardware" route.
Caveats:- Setting a drive up in this way affects the performance of your computer during the writing process to a greater or lesser degree dependent upon exactly what you're doing.
- But it's safer for data security on external drives.
- I set my external drives up with "Quick Removal" enabled, but I still use the "Safely Remove Hardware" icon to be on the safe side. I've been bitten.
- "Just because I'm paranoid doesn't mean they're not out to get me."
- XP can be flaky with this procedure and tell you that you can't remove the drive because it's still in use. This can happen even when you think writing is finished. In that case leave the drive connected or shut Windows down before removal. Vista is much better in this regard.
