From owner-freebsd-questions Fri Sep 27 8:28:16 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 07F6837B401 for ; Fri, 27 Sep 2002 08:28:15 -0700 (PDT) Received: from lurza.secnetix.de (lurza.secnetix.de [212.66.1.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 31B4D43E3B for ; Fri, 27 Sep 2002 08:28:14 -0700 (PDT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [IPv6:::1]) by lurza.secnetix.de (8.12.5/8.12.5) with ESMTP id g8RFS9mC042181; Fri, 27 Sep 2002 17:28:10 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.5/8.12.5/Submit) id g8RFS9HO042180; Fri, 27 Sep 2002 17:28:09 +0200 (CEST) Date: Fri, 27 Sep 2002 17:28:09 +0200 (CEST) Message-Id: <200209271528.g8RFS9HO042180@lurza.secnetix.de> From: Oliver Fromme To: freebsd-questions@FreeBSD.ORG, erdgeist@gate5.de Reply-To: freebsd-questions@FreeBSD.ORG, erdgeist@gate5.de Subject: Re: mounting /usr/ports to multiple jails In-Reply-To: X-Newsgroups: list.freebsd-questions User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.6-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dirk Engling 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