Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Sep 2002 17:28:09 +0200 (CEST)
From:      Oliver Fromme <olli@secnetix.de>
To:        freebsd-questions@FreeBSD.ORG, erdgeist@gate5.de
Subject:   Re: mounting /usr/ports to multiple jails
Message-ID:  <200209271528.g8RFS9HO042180@lurza.secnetix.de>
In-Reply-To: <Pine.BSF.4.43.0209271540450.26761-100000@orion.gate5.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Dirk Engling <erdgeist@gate5.de> wrote:
 > I am running a multi-jail server and want to
 > get rid of having a local copy of /usr/ports
 > in every jail. I thought about mounting it
 > read-only to all jails and modify make.conf
 > appropriately.

One way would be to NFS-export /usr/ports to localhost
(read-only), then mount it from localhost into every jail.
This works pretty well, unless you have more than a few
hundred jails.  Advantage:  When you update the ports, you
just have to update /usr/ports in the host environment.
All the jails will automatically see all changes.  Disad-
vantage:  The mount list can grow pretty large, depending
on the number of jails, which is a bit ugly.

Another way would be to make hard-linked directory trees.
find|cpio can be conveniently used for that purpose:

   # mkdir /jail42/usr/ports
   # cd /usr/ports
   # find . | cpio -dumpl /jail42/usr/ports

That command will create a "shadow" directory tree contai-
ning hardlinks to all the files in /usr/ports.  Disadvan-
tage:  When updating your ports, you have to remove and re-
create all copies of it in your jails, otherwise they won't
see new files, and obsolete files wouldn't disappear.
Another thing to consider is the fact that hardlinks only
work within the same file system, so your jails would have
to be within the same file system as /usr/ports in your
host environment, which is not a good idea.

Personally, I favour the NFS approach.

Regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"All that we see or seem is just a dream within a dream" (E. A. Poe)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209271528.g8RFS9HO042180>