LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-17-2012, 04:22 PM   #1
Blackhole
LQ Newbie
 
Registered: May 2007
Location: Black Forest or West Sussex
Distribution: Xubuntu @ DELL Latitude D620
Posts: 15

Rep: Reputation: 0
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?

Thanks in advance,
Blackhole

Last edited by Blackhole; 02-17-2012 at 04:47 PM.
 
Old 02-17-2012, 05:34 PM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
directly on that USB disk in the future.
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.
 
Old 02-17-2012, 07:21 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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
 
Old 02-17-2012, 09:25 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,307
Blog Entries: 28

Rep: Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136
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
 
Old 02-18-2012, 02:34 AM   #5
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
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.

Thor
 
Old 02-18-2012, 03:06 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,241

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
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.
 
Old 02-18-2012, 04:07 AM   #7
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
As long as it is handled properly it should be just as safe as an internal HDD. However, it may be slower because of USB limits.

You still have to backup your data.
 
Old 02-22-2012, 02:29 PM   #8
Blackhole
LQ Newbie
 
Registered: May 2007
Location: Black Forest or West Sussex
Distribution: Xubuntu @ DELL Latitude D620
Posts: 15

Original Poster
Rep: Reputation: 0
Thank you so much for all your thoughts. That gave me some impressions.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting Linux on an external USB hard drive (not a memory stick, a hard drive) comcastuser Linux - Hardware 4 01-13-2010 06:59 PM
Problems getting external USB hard drive to work pwaring Debian 4 11-24-2008 08:15 AM
external enclosure for an internal hard drive vs external USB hard drive powah Linux - Hardware 1 03-10-2006 09:03 AM
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM
Safe shutdown of external USB hard-drive? blixel Linux - Hardware 3 12-12-2003 12:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration