Recovering a zfs root pool from backup

Chris Stankevitz chris at stankevitz.com
Sun Nov 22 23:05:26 UTC 2015


On 11/22/15 12:32 AM, Karli Sjöberg wrote:
>  > 1. I doubt I can create a new pool called "zroot" on Machine B since it
>  > is already running a pool called "zroot"
>  >
>  > 2. I doubt that this process will create the appropriate "boot sector"
>  > stuff (I do not know what I am talking about here).
>
> Exactly. You'd need to boot the machine from CD/USB to be able to
> receive the stream. About the boot stuff. That would need to be handled
> when partitioning the new drive:
> # gpart create -t gpt (a)?da[0-9]+
> # gpart add -t freebsd-boot -s 64k -l boot0 (a)?da[0-9]+
> # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 (a)?da[0-9]+
> # gpart add -t freebsd-swap -b 2048 -s xg -l swap0 (a)?da[0-9]+
> # gpart add -t freebsd-zfs -a 4k -l sys0 (a)?da[0-9]+
> # sysctl vfs.zfs.min_auto_ashift=12
>
> Also you need to set the "bootfs" property after the receive:
> # zpool set bootfs=zroot zroot

Karli,

Thank you.  Should I be concerned that I cannot "zpool create zroot" 
from my recovery setup because there will already be a pool with that name?

If so, how should I get around that?  I know I can give it a temporarily 
different name and later export/import to rename it -- but it's not 
clear to me that I will ever get that renamed given that I will always 
be running FreeBSD with a zroot.

Perhaps I could give it a different name "zroot2" (and "zpool set 
bootfs=zroot2 zroot2")... boot to that... then rename it back to zroot 
and reboot to complete the restore.

Thank you again,

Chris


More information about the freebsd-fs mailing list