Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Oct 2016 20:40:05 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        JD <jd1008@gmail.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Clone a FBSD system with something in the likes of ghost
Message-ID:  <alpine.BSF.2.20.1610022038320.70405@wonkity.com>
In-Reply-To: <CAN2YBg6qUBXd8qy25zT5FNe9LkyY=x3po1H3UoD1Y2fDxrBvQw@mail.gmail.com>
References:  <CAHieY7TSESodQXBLoZkkBGWZaCbEZessqiMvzp9dR8Y1CoAZtw@mail.gmail.com> <57EC9527.7020202@rcn.com> <alpine.BSF.2.20.1609282305130.7457@wonkity.com> <CAHieY7QV3xYPsNxXdZrYCGO7SA37Mxn_yy2njByR2EBd9DzX9A@mail.gmail.com> <CAN2YBg6qUBXd8qy25zT5FNe9LkyY=x3po1H3UoD1Y2fDxrBvQw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 2 Oct 2016, JD wrote:

> By clone, you mean create a new disk with identical
> content to the cloned disk? Including the boot blocks
> of the cloned disk?
> If so, dump and restore will only perform like a full backup.
> The target (copy-to) disk will not be bootable.
> If you want it bootable, then there is a simlpe procedure
> 1. Obtain a new disk with sufficient capacity as close as possible
>     to size of the source disk. Not less than, though!!
> 2. dd if=</dev/..... i.e. the source disk> of=/dev/..... i.e. the new disk> bs=128M conv=notrunc conv=fdatasync
> 
> When finished, without error,
> the new disk will be a bootable mirror of the original.

There can be problems with that.  GPT secondary partitions will be in 
the wrong place, and this is really bad on SSDs.  It also takes longer 
than necessary because it copies every block, many of which are unused 
and don't need to be copied.
From owner-freebsd-questions@freebsd.org  Mon Oct  3 06:25:31 2016
Return-Path: <owner-freebsd-questions@freebsd.org>
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 C39C8AC61EF
 for <freebsd-questions@mailman.ysv.freebsd.org>;
 Mon,  3 Oct 2016 06:25:31 +0000 (UTC)
 (envelope-from erichsfreebsdlist@alogt.com)
Received: from alogt.com (alogt.com [69.36.191.58])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A4B7AE5E
 for <freebsd-questions@freebsd.org>; Mon,  3 Oct 2016 06:25:31 +0000 (UTC)
 (envelope-from erichsfreebsdlist@alogt.com)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alogt.com; 
 s=default;
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:
 In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=a+9iIF4gUmP+YOfdF2zwyuAPFnC0+sCHsoaaQgw8iw0=; b=Zlw5sDxMkkP2Po+KEDC6zzhT7g
 X+O86Y2F8wN9WLynRiUkYZSi9/k4DZF0YBPmPQUzmLtrkSQREyNHfHQuneKXAsVG81/8qREPgiMgW
 m5gKmBY0SrCCbxsLJhDvbph8yTZH3b4ybmwPFBPFgZigSDRnLGk0PvZoxpaDyhiMWz/8=;
Received: from [114.120.233.15] (port=56832 helo=X220.alogt.com)
 by sl-508-2.slc.westdc.net with esmtpsa
 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87)
 (envelope-from <erichsfreebsdlist@alogt.com>)
 id 1bqwgm-000dZk-IX; Mon, 03 Oct 2016 00:25:25 -0600
Date: Mon, 3 Oct 2016 14:25:16 +0800
From: Erich Dollansky <erichsfreebsdlist@alogt.com>
To: Mario Lobo <lobo@bsd.com.br>
Cc: freebsd-questions@freebsd.org
Subject: Re: Centralizing /usr/src compilation
Message-ID: <20161003142516.7bc18920@X220.alogt.com>
In-Reply-To: <20161002202006.1ff18a15@Papi>
References: <20161001104224.6f276332@Papi>
 <20161002211312.5d04c13d@X220.alogt.com>
 <20161002202006.1ff18a15@Papi>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - sl-508-2.slc.westdc.net
X-AntiAbuse: Original Domain - freebsd.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - alogt.com
X-Get-Message-Sender-Via: sl-508-2.slc.westdc.net: authenticated_id:
 erichsfreebsdlist@alogt.com
X-Authenticated-Sender: sl-508-2.slc.westdc.net: erichsfreebsdlist@alogt.com
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/>;
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 03 Oct 2016 06:25:31 -0000

Hi,

On Sun, 2 Oct 2016 20:20:06 -0300
Mario Lobo <lobo@bsd.com.br> wrote:

> On Sun, 2 Oct 2016 21:13:12 +0800
> Erich Dollansky <erichsfreebsdlist@alogt.com> wrote:
> 
> > On Sat, 1 Oct 2016 10:42:24 -0300
> > Mario Lobo <lobo@bsd.com.br> wrote:
> >   
> > > I hava a src master server (10.3.51.50) where I compile src and
> > > kernel. No CPUTYPE or compiler flags are set. On it, I issued 
> > > make buildworld and make buildkernel that proceed with no errors.
> > > I shared its /usr/src and /usr/obj via nfs.
> > > 
> > > Then, on a slave server, same version and arch as the master, it
> > > has this:
> > >     
> > do both machines have the same CPU? As you did not specify the CPU,
> > the CPU in the server was used as the target. If you have different
> > CPUs but want to use one kernel for all, it might will work if you
> > specify the type of CPU with the least capabilities you have or you
> > compile on that machine.
> > 
> > Erich
> >   
> > > 2>Illegal instruction (core dumped) Illegal instruction (core
> > > 2>dumped)    
> > 
> > Illegal instruction sounds like the target CPU does not know an
> > instruction. Of course, this could also be caused by something else.
> >   
> > > even bury my idea for good as non workable?    
> > 
> > It should work when you set the CPU type.
> > 
> > I also run a kernel compiled for an older Intel CPU on a newer Intel
> > CPU without problems. I never tried it the other way around.
> > 
> > Erich  
> 
> Hi Erich. Thanks for replying!
> 
> Actually, the "slave" server is a guest VM hosted on the "master"
> server.

this is then completely different. I do not know how virtualisation
works on FreeBSD and what a guest sees inside the virtual machine.

Have a very simple try. Compile FreeBSD inside the virtual machine and
check if you can distribute the binaries from one virtual machine to
another one.

I would use jails except in very strange situations when host and guest
are both running FreeBSD.
> 
> Like I said, the slave has the same FBSD version and arch (AMD64) as
> the "master". (I know ... the jail argument, but I still didn't
> master it enough to fell confident for production).
> 
> I did not specify any CPUTYPE because I assumed that if I didn't, it
> would compile for a GENERIC CPU, although I thought that through
> VT-x/AMD-V, the guests sees the same CPU as the host.

I do not know much about GENERIC as I hardly use it.
> 
> Which CPUTYPE should I set? I ask because there are other physical
> machines on the LAN with slightly different CPUs in which I want this
> to work also.

Just set none as the compiler uses then the type of CPU it is running
on.

Erich



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