How safe is it to actively work on an external USB hard drive?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How safe is it to actively work on an external USB hard drive?
Hi there,
as I'm running out of space on my laptop's hard disk, I'd like to put all my documents and work data on an external USB hard drive (ext4), in order to work directly on that USB disk in the future.
How safe is it, if I actively work with my data on that disk? I've read that data changes are only permanently written on a USB hard drive, once you do a "remove safely" via the desktop manager (in my case Xfce). (also see http://elliotli.blogspot.com/2009/01...-in-linux.html)
What happens now if I modify some documents on the USB drive and then...
1.) ...shut down the laptop without unmounting the USB drive first?
2.) ...put the laptop into Hibernate mode and then afterwards unplug the USB drive while the laptop is still turned off.
3.) ...just unplug the USB drive while the system is running without unmounting first.
4.) ...the laptop freezes / crashes and I have to do a forced hardware reset.
All four cases have happened many times before on Windows, but my documents had always been written to the USB drive correctly. How about Linux now?
Is modified data immediatly written to the USB drive or only when unmounting? How likely is it that with one of the four scenarios above my data is not written correctly to the USB drive?
//edit: I know about the mount option "sync". Hwoever I've read that it makes the writting process very slow. So I'm just wondering how safe the normal settings are on let's say a modern Ubuntu 11.10. Maybe there are some internal safety tweaks behind the scene?
Dont...and for some good reasons. An external hard drive is used for backup and restore ONLY. Beyond that (here anyway) the thing is'nt even turned on.
The wear and tear the thing undergoes makes it defy its purpose: backup. Besides, the USB connection makes for a slower drive, anyway.
I suggest making a backup of ALL the data, and using Rsync to sync with the harddrive but work on the internal drive.
Quote:
What happens now if I modify some documents on the USB drive and then...
1.) ...shut down the laptop without unmounting the USB drive first?
2.) ...put the laptop into Hibernate mode and then afterwards unplug the USB drive while the laptop is still turned off.
3.) ...just unplug the USB drive while the system is running without unmounting first.
4.) ...the laptop freezes / crashes and I have to do a forced hardware reset.
In cases 1, 2, 3 and 4 - data that was not saved will be lost. You forgot scenario 5: the drive dies on you, because of too intense use.
If space is at a premium, there are options:
- use a USB key to work on, not my favoured option...
- try to have a bigger drive installed
Good luck
Thor
Last edited by ButterflyMelissa; 02-17-2012 at 05:36 PM.
Huh - why does a USB connected hard-drive suffer more wear than the same drive mounted internally ?.
I regularly test and run disks in a USB enclosure. I don't use them as "everyday" disks, but they do get a work-out. I see no reason to treat them differently to an internally mounted disk. The I/O schedulers and kernel flush threads do their job as required. Any disk is subject to corruption if interrupted. It's just more likely if their is a human involved - as is the case in USB attached devices.
If the laptop is shutdown/hibernated "properly" (i.e. using software, not pulling the power) there should be no problem. On re-mount fsck will run in need.
If you insist on pulling the thing out whilst it is busy you will eventually suffer filesystem errors. I've tested it (deliberately), and you can get serious errors. You can also get away with it.
Don't do it. Simple as that.
But there is no substitute for (good) backups.
Last edited by syg00; 02-17-2012 at 07:22 PM.
Reason: clarification
I have a 250 GB external that I've had for five years or more. I regularly do work on it (mostly executing lxsplit, par2cmdline, and rar commands in the terminal, but sometimes using a file manager for file extraction); I also play media files stored on it (mostly videos). I notice no lag in the videos and the device works like a champ.
By the way, the drive has no off switch. It's plug-and-on.
Based on my experience, I think Thor_2.0's concerns are somewhat greater than necessary. Note that I'm speaking as a personal user about personal data, data the loss of which would be extremely annoying, but not catastrophic.
If I were an organization dealing with vital corporate data, I might well be more cautious.
Mindful that it will one day wear out--everything does, including me--I do not keep vital data on it for long term storage; important stuff gets ported to my file server and/or backed up to removable media after I've finished working on it.
In fact, anything really important gets backed up to at least one other drive and to removable media.
Last edited by frankbell; 02-17-2012 at 09:25 PM.
Reason: Misplet words
Huh - why does a USB connected hard-drive suffer more wear than the same drive mounted internally ?.
I does'nt - but that's not the main reason to buy/use an external drive, in my opinion...besides, the speed stands nowhere compared to an internal one, of course...
Quote:
By the way, the drive has no off switch. It's plug-and-on.
Even better, mine (still) has a switch...and I umount the thing once done. Maybe I'm just too pedantic, but I had one die on me before. Basically burned up right on my desk...
I guess past experience and "trust in the machine" are the main facors here.
The usb drive writes all right, but most write at ~12MB/S) which is the greatest reason for not using it for live data. That's '386 speeds. Because we more often do block copying of 100s of MB to a usb drive, other impressions can be given. Surely running a sync command sorts that?
A guy I worked for regularly swaps drives out live, something I would not do for him. Cable first, then power plug - off and on. As long as an access wasn't taking place, he was ok. Considering atime would be a must in linux. These drives, BTW typically had a few hundred MB of TIFF images of ancient documents, something not that easily replaced.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.