umount error. cannot unmount usb disk

Brian McKee brian.mckee at gmail.com
Mon Sep 8 13:09:04 UTC 2008


On Sat, Sep 6, 2008 at 3:30 PM, Zhengguo Xu <tworiversfolk at gmail.com> wrote:
> so what i did is switching off computer and unplug the drive (for the fear
> of damaging the drive if unpluging it directly) but that is really a pain in
> the ass.
>
> ps: will removing the usb drive without unmounting it first damage the drive
> itself? it seems matters when i use windows. what about it in linux?

Unmounting the drive before you removes it makes sure all the data is
written to the disc before it's unplugged.  There's lots of caches at
various points in the chain that can be hanging onto stuff until it
thinks it's the right time to copy it to the disc.  A half-written
file or similar interrupted process won't physically damage the disc,
but your data will get mucked up!
If it's ext3, and you are *sure* that nothing is using the drive, and
you wait a bit to give it time to catch up on any backlog that's
hanging around, you are probably ok to pull the plug - but if it
breaks you get to keep both halves!

Looking at the lsof output made me wonder if you have Google desktop
or similar that was indexing the contents of that pdf file?  or you
had acroread crash earlier?  lsof can't be wrong as I understand it.

A proper shutdown will sync the disc before it turns off the computer,
so that's safe but slow as you surmised.
I'm *fairly* sure hibernate and/or suspend must also sync the discs -
anybody have reason to think that's not true?

You could also try using the sync command (man sync) to try and make
sure all the data is written before you pull the plug - belt and
suspender type thing.  There was a discussion on either this list or
debian-user about this earlier this summer (that's a lot of mail to
dig thru I know)

Brian




More information about the ubuntu-users mailing list