April 26, 2012

Deleting files from an external drive: Why is it so slow?

By Lynn Evans

If you've ever tried to delete a large number of files (or a small number of large files) from an external disk drive, you'll know that the process can take an inordinately long time.

I found this out the other day. I was cleaning up my external backup drive, and I needed to delete a couple of gigabytes of data to make way for my new backup folders. The "Deleting …" message appeared as usual - and was still there 15 minutes later. I clicked the Cancel button, only to find that just a small fraction of the files had actually been erased.

Fortunately, it didn't take me long to realize why deleting these files was so slow - and what I could do to speed it up.

As you know, when you delete a file, by default Windows moves it to the Recycle Bin. If the file is on the same drive as the bin, that process is almost instantaneous, as the operating system merely has to change the file's directory entry to point to its new location. But if the file is on an external drive, it has to be copied across to the internal drive - the one holding the Recycle Bin - before it can be erased. Moving multiple gigabytes of data in that way inevitably takes a long time.

By-pass the bin

Fortunately, it's an easy matter to by-pass the Recycle Bin. Doing so means that deleting a file from an external drive will be very much faster. But, of course, you should only take this route if you're sure you won't need to recover the file later.

The easiest way to by-pass the Recycle Bin is to hold down the Shift key when you perform the deletion. This is true regardless of whether you press the Del key or you right-click and choose Delete from the Context menu. Either way, Windows will prompt you to confirm the deletion (it will only issue this prompt once, not once per file). It will then permanently delete the file.

DOS commands

You can also by-pass the Recycle Bin by using the command prompt to perform the deletion. If your knowledge of DOS commands is a bit rusty, don't worry. There are only two commands you need to know.

You can use the DEL command to delete individual files (as opposed to folders). The command works with wildcard characters, so DEL G:\BACKUP\*.* will delete all files in the G:\BACKUP folder - but not the folder itself. RD (short for Remove Directory) deletes an empty folder. RD with the /S switch deletes a folder and all files and folders within it. For example, RD G:\BACKUP /S will delete the whole of G:\BACKUP and everything in it.

Disable the bin

A third option is to temporarily disable the Recycle Bin. To do so, right-click on the bin's icon on your desktop, and choose Properties from the context menu. Look for an option labeled "Don't move files to the Recycle Bin. Remove files immediately when deleted". Clear the checkmark against this option. After you've done that, all deletions - not just those from the external drive - will avoid the Recycle Bin. So use this option with care, and be sure to reverse it when you have finished the deletions.

Finally, keep in mind that none of the above is relevant if the external drive is a removable drive, such as a floppy disk, CD-ROM or thumb drive. In those cases, files are always deleted immediately, and the Recycle Bin doesn't enter the picture.

No comments:

Post a Comment