View Full Version : Does pulling out a drive actually risk damaging it?
ThinkBuntu
May 3rd, 2007, 07:23 PM
I used a thumb drive for about a year in school on strictly Windows machines and always just yanked it out (I hate how long it takes to "Safely Remove Hardware"), and although the computer flashed a warning, I never lost any data. This included migrating data between a Mac, a Linux and many PCs. Now I'm a little more careful because I have a theory that maybe some data recently added is written to the drive on eject. But even so...does yanking a drive out actually do anything wrong?
gerscht
May 3rd, 2007, 07:38 PM
Although I most of the time do the same :) modern OS try to be as efficient as possible and wait for a bunch of data to be written. If you yank it then, the files won't be written. This is mostly likely the case if you're writing many small files to the drive.... Writing just one big file and pulling it out as soon as the copy window disapears shouldn't do any harm
use a name
May 3rd, 2007, 07:39 PM
It might. I've seen writes being postponed as long as possible, even until after I 'ejected' it. Didn't work...
ThinkBuntu
May 3rd, 2007, 07:44 PM
I don't want to turn this into a question post, because I intended it as a curiosity one (hence the location), but I wonder if there's a way to make your system take care of the writes immediately...?
lcg
May 3rd, 2007, 08:00 PM
I used a thumb drive for about a year in school on strictly Windows machines and always just yanked it out (I hate how long it takes to "Safely Remove Hardware"), and although the computer flashed a warning, I never lost any data. This included migrating data between a Mac, a Linux and many PCs. Now I'm a little more careful because I have a theory that maybe some data recently added is written to the drive on eject. But even so...does yanking a drive out actually do anything wrong?
Well, you cannot physically damage a USB storage device by simply unplugging it.
However, the file system on the device is a different story. If you just pull it out, the operating system might be in the middle of writing to it. In that case, you may lose the data you were writing partially or completely. Or it could create inconsistencies between what is actually on the file system and the administrative data. Also, Ubuntu caches data before actually writing it to a file system, so if you just unplug it, the OS cannot flush the cache to the file system. (IIRC, Windows does not use a cache for removable drives by default, for exactly this reason.)
If you eject the medium (or use Windows' "Safely Remove Hardware"), you instruct the operating system to sync the data to the file system and then unmount it. That way, the data is comletely and consistently written to the file system before unplugging the medium.
HTH,
Lars
LaRoza
May 3rd, 2007, 08:02 PM
YES. At the least, you'll wipe the formatting and have to reformat it, at the most you can destroy the circuitry.
Learn from others mistakes.
lcg
May 3rd, 2007, 08:05 PM
I don't want to turn this into a question post, because I intended it as a curiosity one (hence the location), but I wonder if there's a way to make your system take care of the writes immediately...?
There is a mount option 'sync' (see 'man mount') which instructs the OS to make all write operations on that file system synchronously, i.e. without caching. I don't know, however, how to make Ubuntu mount all removable media with that option.
HTH,
Lars
richbiskit
May 3rd, 2007, 08:11 PM
I have found that with my generic mp3/usb storage device that if i just pull it out it doesn't save any changes that i have made but unmounting it in Ubuntu/safely remove in Kubuntu everything is fine. As for actually damaging it i doubt it very much.
gerscht
May 3rd, 2007, 08:41 PM
There is a mount option 'sync' (see 'man mount') which instructs the OS to make all write operations on that file system synchronously, i.e. without caching. I don't know, however, how to make Ubuntu mount all removable media with that option.
The option is in
/etc/hal/fdi/policy/preferences.fdi
The default is that devices smaller than 1gb are mounted for synchronously write.
zek725
May 28th, 2007, 02:09 AM
So, in layman terms, Unmounting/Ejecting the drive is the Ubuntu counterpart of Windows' Safely Remove Hardware?
FuturePilot
May 28th, 2007, 02:34 AM
I've never had a problem just pulling it out from XP. Although I always eject it in Linux. To me that Safely Remove option in Windows is crap and useless. It's so confusing since it lists a ton of stuff that you're not concerned with like the USB bridges:roll:
So the easiest way to safely remove a drive from Windows is to just open My Computer, find the removable drive, right click and select Eject. Much easier than searching through a whole list of stuff just to find your device. I never could figure that out. I think I always end up ejecting the wrong thing.
prizrak
May 28th, 2007, 04:33 AM
XP is set for quick removal, meaning that all the data is written to a removable drive as soon as it is set to copy. As someone mentioned Ubuntu does that to any drive smaller than 1 gig. So if you are using something bigger than that in Ubuntu and use Nautilus your data might not be written until after you choose to eject it. In my experiece rsync actually pushes all the data as soon as possible.
Quillz
May 28th, 2007, 04:45 AM
For the most part, you can simply plug/unplug a USB drive in any OS without ill side effects. But it's always better (when possible) to use the safely remove hardware option, just in case.
smoker
May 28th, 2007, 08:08 AM
having borked a usb flash drive before (128mb in windows), by unceremoniously unplugging without using the safe removal procedure, i always verge on safety now, on windows and linux.
the files in the borked 128mb drive started reading at 4GB (yes!) in size and couldn't be opened. reformatting the drive didn't work, it was well fubar. so, lesson learned!:-)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.