[Server-devel] automount external HD

Martin Langhoff martin.langhoff at gmail.com
Mon Oct 18 16:15:32 EDT 2010


On Thu, Oct 14, 2010 at 1:15 AM, Sameer Verma <sverma at sfsu.edu> wrote:
> I am using XS-on -XO1 version 0.6.

Excellent!

> I want to use an external USB hard drive and mount it as /library at
> boot time. I have added a line in /etc/fstab
>
> /dev/sda1   /library    ext3   defaults   0  0

as others have noted, you probably want "auto" in there. The udev
"mount -a" trick is good too.

This is something I wanted to support on 0.6 but ran out of time, and
has been simmering in the back of my mind for a while. This thread
make me think a bit about it, and made me realise that it is currently
probably pretty dangerous.

Here is what is dangerous: we need /library mounted very early, and
always mounted. Else, data corruption and general messiness looms.
What counts on /library ? In order of seriousness...

 - PostgreSQL has it's DB there. And if its datadir is not there, the
init script will assume it's first boot and initialise the directory.

 - Moodle -- needs Pg, if it finds an empty DB it will initialise one.

 - idmgr -- registration creates a userdir there. If it's not mounted,
it will create userdirs under the directory used for the mountpoint.
(Or maybe a soft failure)

 - backups -- probably a soft failure if /library isn't there

 - apache, xs-activation -- soft failures due to missing data

To handle this in a less risky manner, we'd need the main services to
only run if the "real" library is there. With that in place, the udev
trick would need to extend to re-starting some services, or the
services would need a "supervisor" script "listening" for the mount
via inotify.

Which is a lot of garbled talk to mean: it'll be fine for a test
server. Where we need this to be bulletproof and failsafe, lots of
work to do...

cheers,



m
-- 
 martin.langhoff at gmail.com
 martin at laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff


More information about the Server-devel mailing list