From owner-freebsd-questions Wed Oct 3 2:59:54 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-31-203-60.mmcable.com [65.31.203.60]) by hub.freebsd.org (Postfix) with SMTP id A503637B403 for ; Wed, 3 Oct 2001 02:59:50 -0700 (PDT) Received: (qmail 38523 invoked by uid 100); 3 Oct 2001 09:59:50 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15290.57750.60631.476946@guru.mired.org> Date: Wed, 3 Oct 2001 04:59:50 -0500 To: Tim Singletary Cc: questions@freebsd.org Subject: Re: `cp -Rp' vs `pax -r -w'; setting up multiple jails In-Reply-To: <66297919@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ 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 Tim Singletary types: > I'm setting up several nearly-identical jails on the same computer. > It takes several hours to set up each from scratch; I'd like to be > able to set up the first jail and then use it as a template to set up > the remaining jails. > > My `template' jail is in /jail/192.168.0.61; I want to set up > additional jails in /jail/192.168.0.62, /jail/192.168.0.63, etc. I've > tried several ways to copy the template tree, including: [describes problems with hard links] > Both methods work acceptably, but neither is perfect. Is there a > better way? Both tar and cpio handle hard links correctly. If you plan to keep a static template, I'd suggest tarring up and compressing the template directory. Then just untar it to create the new one. If you want to copy whatever is currently in the template directory, I'd recommend something like: # cd /jail # find 192.168.0.61 -print0 | cpio -pd0 tmp # mv tmp/192.168.0.61 192.168.0.63 You can even use the -l option so that it just creates hard links between the files in the two jails, if that's an acceptable option for you. http://www.mired.org/home/mwm/ Q: How do you make the gods laugh? A: Tell them your plans. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message