From owner-freebsd-questions@freebsd.org Mon Oct 7 15:19:15 2019 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 232C1131E83 for ; Mon, 7 Oct 2019 15:19:15 +0000 (UTC) (envelope-from mike@sentex.net) Received: from pyroxene.sentex.ca (pyroxene.sentex.ca [IPv6:2607:f3e0:0:3::18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "pyroxene.sentex.ca", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46n3zj6vrjz48Yn for ; Mon, 7 Oct 2019 15:19:13 +0000 (UTC) (envelope-from mike@sentex.net) Received: from [IPv6:2607:f3e0:0:4:58ac:cc63:ba54:8f64] ([IPv6:2607:f3e0:0:4:58ac:cc63:ba54:8f64]) by pyroxene.sentex.ca (8.15.2/8.15.2) with ESMTPS id x97FJ9jb000946 (version=TLSv1.2 cipher=AES128-SHA bits=128 verify=NO); Mon, 7 Oct 2019 11:19:11 -0400 (EDT) (envelope-from mike@sentex.net) Subject: Re: Guides for ZFS Full backup to NFS drive and restore from NFS drive To: Alejandro Imass Cc: FreeBSD Questions References: <9177b014-9041-f51e-1856-b6dbdec4afc1@panix.com> <20191005104413.39e3c081.freebsd@edvax.de> From: mike tancsa Openpgp: preference=signencrypt Autocrypt: addr=mike@sentex.net; keydata= mQENBFywzOMBCACoNFpwi5MeyEREiCeHtbm6pZJI/HnO+wXdCAWtZkS49weOoVyUj5BEXRZP xflV2ib2hflX4nXqhenaNiia4iaZ9ft3I1ebd7GEbGnsWCvAnob5MvDZyStDAuRxPJK1ya/s +6rOvr+eQiXYNVvfBhrCfrtR/esSkitBGxhUkBjOti8QwzD71JVF5YaOjBAs7jZUKyLGj0kW yDg4jUndudWU7G2yc9GwpHJ9aRSUN8e/mWdIogK0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jQf/dBCjAVn1J0GzSsHiLvSAQz1cchbdy8LD0Tnpzjgp5KLU7sNojbI8vqt4yKAi cayI88j8+xxNXPMWM4pHELuUuVHS5XTpHa/wwulUtI5w/zyKlUDsIvqTPZLUEwH7DfNBueVM WyNaIjV2kxSmM8rNMC+RkgyfbjGLCkmWsMRVuLIUYpl5D9WHmenUbiErlKU2KvEEXEg/aLKq 3m/AdM9RAYsP9O4l+sAZEfyYoNJzDhTZMzn/9Q0uFPLK9smDQh4WBTFaApveVJPHRKmHPoNF Xxj+yScYdQ4SKH34WnhNSELvnZQ3ulH5tpASmm0w+GxfZqSc8+QCwoKtBRDUxoE56A== Message-ID: Date: Mon, 7 Oct 2019 11:19:04 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 46n3zj6vrjz48Yn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mike@sentex.net designates 2607:f3e0:0:3::18 as permitted sender) smtp.mailfrom=mike@sentex.net X-Spamd-Result: default: False [-4.36 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sentex.net]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(-2.06)[ip: (-1.70), ipnet: 2607:f3e0::/32(-4.94), asn: 11647(-3.56), country: CA(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11647, ipnet:2607:f3e0::/32, country:CA]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Oct 2019 15:19:15 -0000 On 10/7/2019 11:14 AM, Alejandro Imass wrote: > > > On Mon, Oct 7, 2019 at 8:28 AM mike tancsa > wrote: > > On 10/5/2019 8:35 AM, Alejandro Imass wrote: > > Nope you definitely understood the question precisely. > > What I want to do now is backup the entire system, reconstruct > the raid1 > > pool and then restore the whole system INTACT. > > > Something like this ? > > > Wow Mike ! Thanks a lot for taking the time to provide this step by > step recipe!! > > I will go over it and try it out and document the whole thing with > explanations etc. to try to push some of this info onto the handbook > so that regular users like myself will be able to deal with these > common scenarios.  > > I'll keep the list posted on this thread... > > Thanks again!! No problem. Some other notes, if you want to create an actual image that you then want to virtualize, you can use mdconfig to experiment with *Note, if you are restoring a RELENG_10 image* on a RELENG11 image, make sure you grab the boot loader info from a matching RELENG_ image. Also, be aware that if you have a pool name that is not zroot, set the bootfs accordingly Another important note-- if you want to import a RELENG_10 zfs file system into a vm image and then boot that image, you will need to create the zpool image with all feature flags disabled on RELENG12 as the version is different. The *option -d* will do this. Dont forget to use the same boot info as well. So pmbr and gptzfsboot should be sourced from a releng_10 image. #create a RELENG10 vm and then work with it on releng_12 rm server.img truncate -s 1TB server.img mdconfig -f server.img gpart create -s gpt md0 gpart add -s 512 -t freebsd-boot md0 gpart add -s 1G -t freebsd-swap md0 gpart add -t freebsd-zfs md0 gpart bootcode -b /tmp/pmbr -p /tmp/gptzfsboot -i 1 md0 zpool create -d -f -o altroot=/mnt2 -O canmount=off -m none zroot /dev/md0p3 gzcat zroot-.0.gz | zfs recv -vF zroot gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 md0 zpool import -f -o altroot=/mnt2 zroot zpool set bootfs=zroot/ROOT/default zroot Some common problems-- if the machine you are virtualizing does NOT have the virtio drivers, make sure the disk driver you choose in KVM is SATA. Otherwise you get a cryptic "cannot file zfs pool labeled xxx"... thats because there is no "disk" seen by the kernel. Change the driver to be SATA then. Same with network drivers etc. You can load them via kld at the loader prompt if they are not compiled in *if_vtnet_load="YES" virtio_blk_load="YES" virtio_pci_load="YES"* >