Re: [Server-devel] automount external HD

2010-10-18 Thread Martin Langhoff
On Mon, Oct 18, 2010 at 2:56 PM, Sameer Verma sve...@sfsu.edu wrote:
 I haven't tested it, but if you create 92-mount.rules (or whatever 90
 something is available) in /etc/udev/rules.d with this...

 SUBSYSTEM==block, run+=/bin/mount -a

It's a clever move, but after thinking about it, it is actually pretty
dangerous. So it'll work for it will probably mess up your XS big
time values work.



m
-- 
 martin.langh...@gmail.com
 mar...@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
___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


Re: [Server-devel] automount external HD

2010-10-18 Thread Martin Langhoff
On Thu, Oct 14, 2010 at 1:15 AM, Sameer Verma sve...@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.langh...@gmail.com
 mar...@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
___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


Re: [Server-devel] automount external HD

2010-10-16 Thread Sameer Verma
On Thu, Oct 14, 2010 at 3:20 PM, Martin Langhoff
martin.langh...@gmail.com wrote:
 On Thu, Oct 14, 2010 at 1:15 AM, Sameer Verma sve...@sfsu.edu wrote:
 Any ideas?

 I think you can configure usbmount to make a special case of your
 external disk. Note that you'll have to copy all the data from the
 preexisting /library ! Make the changes in single user mode to make
 sure you don't try to move the PG database or the user backups while
 they are running ;-)


So, moving /library to the external disk in single user mode was no
problem. I see a bunch of files in /etc/usbmount.d Is that where I set
something up, or do I mess with /etc/usbmount/usbmount.conf? Not sure
which way to proceed...a bit beyond my skill set. I'll happily follow
directions and write it up if one of you can point me to an example or
tell me what to do.

I take it that if /library is set up in usbmount, then it is redundant
in /etc/fstab?

Sameer


 m
 --
  martin.langh...@gmail.com
  mar...@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



___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


Re: [Server-devel] automount external HD

2010-10-16 Thread Martin Langhoff
On Sat, Oct 16, 2010 at 2:00 AM, Sameer Verma sve...@sfsu.edu wrote:
 something up, or do I mess with /etc/usbmount/usbmount.conf? Not sure

IIRC -- haven't looked at usbmount code or docs in a while... you
should be able to config usbmount to recognize that drive somehow and
mount it in a particular mountpoint / partition.

Research required :-)


m
-- 
 martin.langh...@gmail.com
 mar...@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
___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


Re: [Server-devel] automount external HD

2010-10-16 Thread Anna
If you've got an /etc/fstab entry for the drive, you could tell udev to
mount it.  I think this'll require the auto option in fstab.

I haven't tested it, but if you create 92-mount.rules (or whatever 90
something is available) in /etc/udev/rules.d with this...

SUBSYSTEM==block, run+=/bin/mount -a

...It should automagically mount where fstab tells it to.  But again, I
haven't tested it.  Just an idea.

Anna Schoolfield
Birmingham
___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


Re: [Server-devel] automount external HD

2010-10-14 Thread James Cameron
On Wed, Oct 13, 2010 at 10:15:55PM -0700, Sameer Verma wrote:
 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   /libraryext3   defaults   0  0

Might you instead mount by UUID or LABEL?

 However, this won't mount at boot time.

There's no auto in the fourth field.

-- 
James Cameron
http://quozl.linux.org.au/
___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


Re: [Server-devel] automount external HD

2010-10-14 Thread Sameer Verma
On Wed, Oct 13, 2010 at 11:19 PM, James Cameron qu...@laptop.org wrote:
 On Wed, Oct 13, 2010 at 10:15:55PM -0700, Sameer Verma wrote:
 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

 Might you instead mount by UUID or LABEL?


I will try this tomorrow.

 However, this won't mount at boot time.

 There's no auto in the fourth field.


I changed that to auto but that does not work either. Here's the other
interesting thing. The USB drive shows up under lsusb but is not auto
mounted. df -h doesn't show it. mount -a results in a /dev/sda1 does
not exist. Then if I unplug the USB cable and plug it back in, the
drive gets recognized and automounts twice. Once at the /library
mountpoint and once at the /mnt/usb0 mountpoint. Could be a conflict
between fstab and udev?

Sameer

 --
 James Cameron
 http://quozl.linux.org.au/
 ___
 Server-devel mailing list
 Server-devel@lists.laptop.org
 http://lists.laptop.org/listinfo/server-devel
___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


Re: [Server-devel] automount external HD

2010-10-14 Thread Jerry Vonau
On Thu, 2010-10-14 at 00:24 -0700, Sameer Verma wrote:
 On Wed, Oct 13, 2010 at 11:19 PM, James Cameron qu...@laptop.org wrote:
  On Wed, Oct 13, 2010 at 10:15:55PM -0700, Sameer Verma wrote:
  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   /libraryext3   defaults   0  0
 
  Might you instead mount by UUID or LABEL?
 
 
 I will try this tomorrow.
 
  However, this won't mount at boot time.
 
  There's no auto in the fourth field.
 
 
 I changed that to auto but that does not work either. Here's the other
 interesting thing. The USB drive shows up under lsusb but is not auto
 mounted. df -h doesn't show it. mount -a results in a /dev/sda1 does
 not exist. Then if I unplug the USB cable and plug it back in, the
 drive gets recognized and automounts twice. Once at the /library
 mountpoint and once at the /mnt/usb0 mountpoint. Could be a conflict
 between fstab and udev?

The package usbmount is reason for the behaviour you are seeing.

http://dev.laptop.org/git/users/martin/usbmount.git/

Jerry



___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel