From owner-freebsd-questions@freebsd.org Wed Sep 2 19:48:56 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F74B9C8E34 for ; Wed, 2 Sep 2015 19:48:56 +0000 (UTC) (envelope-from kozlov.sergey.404@gmail.com) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [IPv6:2a00:1450:4010:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3D74859 for ; Wed, 2 Sep 2015 19:48:55 +0000 (UTC) (envelope-from kozlov.sergey.404@gmail.com) Received: by lamp12 with SMTP id p12so13690451lam.0 for ; Wed, 02 Sep 2015 12:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=HT+TwVtFTa+QhGgDx/G3Z1vo7EZLbJSXOZwdoK0btb0=; b=KURaumAbofUwPnasXN4i/8JrGN++zD3CeJL8/KOWP8aN9tRdrHPmMK17oZO/yhiQYG P/BhwELDdrXtryjMMe0yq1mYcDxfSoyE2in0sTGjHbayEhQag/1/NmVBAAIW2U/E8RpN fh7eF13BCWSPbPpjIHDQrYMu2ZbjPMRM5GAKVCUsxzMBMc92NjavNAWxnNEyS6DhdWxu uKXdQMCZT9iY0XPZkeLogOXr0OI2iRc5R0BVvPbvcRkL+zdHY5Zj+cTtTBQFE2KICoR3 BLniVZeAlGaufyWqXgo/+Lt830h0HXhcjsphgAHx+11IYrTdRGL09sNnwYK580SOS+JX FxIw== X-Received: by 10.112.161.137 with SMTP id xs9mr18048795lbb.4.1441223333966; Wed, 02 Sep 2015 12:48:53 -0700 (PDT) Received: from [192.168.210.11] (89-71-237-249.dynamic.chello.pl. [89.71.237.249]) by smtp.googlemail.com with ESMTPSA id y8sm5777336lbf.35.2015.09.02.12.48.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 12:48:53 -0700 (PDT) Subject: Re: How to convert a physical host into a Jail? To: Raimund Sacherer References: <1191031848.12018409.1441206551674.JavaMail.zimbra@logitravel.com> Cc: FreeBSD Questions From: Kozlov Sergey X-Enigmail-Draft-Status: N1110 Message-ID: <55E752A2.6080207@gmail.com> Date: Wed, 2 Sep 2015 21:48:50 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1191031848.12018409.1441206551674.JavaMail.zimbra@logitravel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2015 19:48:56 -0000 Hello Raimund, First, if you're using ZFS for the whole system you can "zfs send"/"zfs receive" the root dataset to one of the folders, where your jail will reside. I don't know if that jail will be usable right away or not, maybe there will be some tweaking required. One thing I'm sure about is that in jail you won't need any boot-related stuff including the kernel as jails share it with the host, so you can delete it to save some space and not to confuse any update tools in the future. Second, if your jail needs to manage the zfs datasets you can dedicate a branch of your zfs dataset tree to a jail by using the "zfs jail" command. Note though that you have to issue "zfs jail" each time you start the jail (i never used iocage but I bet it has functionality to run some script after start of the jail) and after you dedicate the zfs branch to the jail it won't be accessible from the host before you issue the "zfs unjail" command. Regards, Sergey Kozlov On 02.09.2015 17:09, Raimund Sacherer wrote: > Hello, > > the first server I set up in our production environment was a backup server. Its FreeBSD 10.0 and I installed our backup server directly without creating jails first. > > Now that I am much more familiar with FreeBSD and jails (iocage) I would like to: > > clone (move, sync, ...?) the physical host into a iocage jail > after the clone works stop and remove the services from the host > > Then upgrade to 10.2. > > I am not sure on how to correctly move the physical host installation to the jail, also not sure about the correct way for the jail to get to various zfs datasets which our backup server needs. Allow them to mount in the Jail? Move them from where they are to beneath the jail? What are the differences? > > Thank you > Best > Ray > >