[mdlug] External Hard Drives: Mounting, Unmounting, Partial Mounting?

Robert Meier eaglecoach at wwnet.com
Sun Jan 20 11:53:13 EST 2008


Elisa,

I believe you are encountering the limits of your bios.
You have several alternatives (identified at end).



The external hard drive was unknown to your laptop manufacturer,
so they did not account for it in the bios,
and there is no standard yet for how to handle external drives
during suspension.

When suspending, your computer is probably turning off the usb(?)
port to the external drive, and the external drive sensing
disconnection is hopefully landing its head
(i.e. securing itself for movement).

Think of the usb cord as a phone connection between your laptop
and your hard disk.  When your computer suspends, it "hangs up the
phone" and prepares to move.  Your external drive, when it realizes
the phone is dead, also hangs up, and (hopefully) prepares to move.
When you open your laptop, the computer doesn't know
that the external drive is still there (rather than unplugged,
replaced with a different external device or external drive).
Mounting is analagous to making that phone call, waiting for their
answer, saying hello, and achieving recognition.  Unmounting
is analagous to saying goodbye, waiting for any last minute
requirements, satisfying the last minute requirements, and after
they say goodbye, hanging up.

For reliable operation, you need to unmount all your devices before
suspension.  Without unmounting, you risk data loss or corruption,
as something may have been waiting in memory until the spinning
disk (or whatever) was ready to receive it.  Likewise you need
to mount all desired devices after suspension.

For your convenience, your bios should automatically unmount several devices
when you suspend, and mount them again when you open your laptop.
However, the devices the bios can mount and unmount is limited by the knowledge
of its designers, and what your laptop manufacturer paid for.  Usually it
is only the devices built into the laptop itself.  (My prior laptop bios
did not mount or dismount the removeable cd drive.)

For your convenience, most linux distros supply a daemon (eternal process)
that periodically checks for "new hardware" and trys to mount it by searching
for its description in configuration files.  There is a necessary tradeoff,
between latency detecting a new device, and time wasted too frequently
checking.

<IMHO>
Because of annoying multiple mountings, and my own impatience,
I prefer to turn my "new hardware detector" off, and find it easier
to habitually unmount and remount any external devices (e.g. thumb drive)
by hand before and after suspension.  My typing delay is usually long enough
for the devices to prepare themselves,
and less than the period I'd have to wait for the "new hardware detector".
</IMHO>



Alternatives:
  1. Get in habit of unmounting and mounting before and after suspension.
  2. Add/extend scripts to unmount and mount before and after suspension.
  3. Wait patiently after suspension until "new hardware detector" mounts.
     Wait patiently before suspension until everything gets flushed.
  4. Tweak "new hardware detector" to mount more reliably.
     Wait patiently before suspension until everything gets flushed.
  5. Don't unmount and don't complain about data corruption.

Personally, I chose alternative 1, started investigating alternative
2 and 4.  (I made little progress in my investigation, and don't even
remember my "new hardware detector" package name, so I'll be interested
in what others provide.)  

Others on this list should be able to help you, if you choose alternatives
1, 2, 3, or 4.

Hopefully helpful,
-- 
Robert Meier
mailto:eaglecoach at wwnet.com

  "If an elderly but distinguished scientist says that something is possible,
   he is almost certainly right;
   but if he says that it is impossible, he is very probably wrong."
     -- Arthur C. Clarke




More information about the mdlug mailing list