[Gllug] Multiple Distro's, one swap partition?

Nix nix at esperi.org.uk
Sat Mar 27 14:04:17 UTC 2004


On Mon, 22 Mar 2004, Pete Ryland spake:
> On Sat, Mar 20, 2004 at 06:20:36PM +0000, Nix wrote:
>> #!/bin/bash
>> #
>> # Populate /home with bind-mounts.
>> #
>> 
>> for name in `find /home -type d -maxdepth 1 -mindepth 1 | sed 's,/home/,,' | grep -v '^\.'`; do
>>     DIR=`find /home -type d -maxdepth 2 -mindepth 2 -name $name | grep '^/home/\.' | head -1`

that is,

    DIR=`find /home -type d -maxdepth 2 -mindepth 2 -name $name | grep '^/home/\.' | head -1`

of course.

>>     [[ -n $DIR ]] && mount -o bind $DIR /home/$name
>> done
>> 
>> and that'll pick out the home directories from their dot-directories and
>> bind-mount them into place.
> 
> *Very* cool.  Just a suggestion, but to remove the dot-leading username
> limitation, and make the bind-mount script slightly simpler, wouldn't it be
> easier to use a naming scheme like so?  Or am I missing something?
> 
> /home/.nfs/svn.esperi.org.uk/nix
> /home/.nfs/svn.esperi.org.uk/gerald
> /home/.nfs/inferno.esperi.org.uk/locutus
> /home/.nfs/inferno.esperi.org.uk/billg
> /home/.nfs/inferno.esperi.org.uk/darl
> /home/nix
> /home/gerald
> etc.

Nice idea without any downsides as far as I can see. I'll incorporate
it. :)

> BTW, is lost+found not an issue?

Not unless you want to have a user *called* `lost+found'; populate-home
only picks up users with directories under /home, y'see, and there's no
point making /home an fs of its own on a system configured like this, so
there'll never be a /home/lost+found for any other reason.

(/home/.{blah}, now, *is* an FS of its own.)

-- 
`The game proceeds with people picking up cards in turn, and every so
 often this is punctuated with a church council when everyone goes mad
 and starts yelling and playing cards at each other and persecuting and
 making deals.' --- Jo Walton on _Credo_
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list