TechViews News …..
We’ve all done it, simply pulled a USB flash drive out of its port. But how many times have we lost data on that USB drive when we did that? It’s certainly happened to me, and I’ll bet it’s happened to you as well. All it takes is a one-time event on that drive, and you lose not only the data, but often lose the drive, too.
What is best is to have a way to safely and securely remove a USB drive without harming the data on wither your computer or your USB drive.
There is a way to safely eject a USB drive from its port, and now I use it without fail. But if you haven’t had a data loss from simply pulling the USB drive from its port, you may ask why do we need safe removal at all?
Historically, operating systems (OS) treat disks as objects that can be trusted not to change state suddenly. When reading or writing files, the OS expects the files to remain accessible and not suddenly disappear in mid-read or mid-write. If a file is open, a program reading the file expects to be able to return to it and continue reading. Similarly, write commands may be dispatched to a writing subroutine and forgotten by the main program. If a drive disappears between the time the subroutine is called on, and the data is written to disk, that data is lost forever.
In the early days of computing, there were formal processes to physically “mount” and “unmount” storage media, and the physical act of mounting a tape or a disk pack triggered a switch to detect the presence or absence of media. Once the mechanism was engaged, the software could start to use the media (a “soft mount”). Some early devices even had a mechanical interlock to prevent media from being ejected or removed until the software processes using the media released the lock.
The floppy disk provides an example of an interlocked physical mount. One could only eject media through a software command or an eject button, but that command might fail if some program was holding a file open on the medium.
Enter USB connected storage. There is no mechanical interlock in a USB connection to coordinate the hard and soft mount. The user can decide to rip the disk out from under the operating system at any time, and endure all manner of programs freaking out about the sudden loss of media. Symptoms could include: Lost data, corrupted file systems, crashing programs, or hanging computers requiring a reboot. A safe removal executes the “soft unmount” and disconnect needed to prevent any unexpected Bad Things that may happen if a program loses its access to media.
A safe removal does a few things:
- It flushes all active writes to disk.
- It alerts all programs (that know how to be alerted) that the disk is going away, and to take appropriate action.
- It alerts the user when programs have failed to take action, and still are holding files open.
You can remove a disk at any time, but you are at the mercy of how well programs using the disk cope with the sudden disappearance of that disk.
In the modern computer, many steps have been taken to defend against careless removal of media. But, it is very hard to get people to change habits. Learning to safely remove a USB flash drive from your computer just might save you the loss of some mighty important data.
However, safe removal does a number of important things and is, in fact, the only assuredly safe way to remove a disk. You probably don’t need it most of the time, but it is a good habit to have since data loss is not a good thing.
How to Safely Remove a Flash Drive
When you insert a flash drive into a computer running Windows 7, 8 or 8.1, an icon reading Safely Remove Hardware and Eject Media displays on the system tray. To unplug your flash drive, right-click that icon, and select Eject USB Flash Drive. If it’s safe to eject, a notification displays Safe to Remove Hardware.
If instead, the utility notifies you that the flash drive is in use, close any files or applications that you are running off the flash drive, and then try again. If a random process still prevents you from ejecting the flash drive, log off of your Windows user account, log back on, and retry.
Be Safe – Backup Your Data Regularly!
And don’t forget to take advantage of our FREE subscription to the TechViews.org Newsletter. A must-read if you are interested in Internet Security.