Date: Sun, 22 Nov 2015 08:32:01 +0000 From: =?utf-8?B?S2FybGkgU2rDtmJlcmc=?= <karli.sjoberg@slu.se> To: Chris Stankevitz <chris@stankevitz.com> Cc: FreeBSD Filesystems <freebsd-fs@freebsd.org> Subject: Re: Recovering a zfs root pool from backup Message-ID: <8834bc1f-4e73-4315-a591-a4ff89dc80c9@email.android.com>
next in thread | raw e-mail | index | archive | help
Den 22 nov. 2015 8:24 fm skrev Chris Stankevitz <chris@stankevitz.com>: > > I have a 'zroot' as setup by the FreeBSD install procedure on "Machine > A". I back it up like so: > > zfs snapshot -r zroot@backup > > zfs send -Rv zroot@backup > /path/to/external/drive/zroot.backup.bin > > Let's assume that "Machine A" zroot pool is destroyed. On "Machine B" I > issue these commands: > > zpool create zroot /dev/new/drive > > cat /path/to/external/drive/zroot.backup.bin | zfs receive -d zroot > > I do not believe that this will create a working drive for Machine A > because: > > 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 /K > > Can you provide a solution to either of these problems and/or identify > other problems with my backup/restore procedure? > > Thank you, > > Chris > > PS: The system is a file server with nearly all data stored on a zpool > that is not "zroot". > _______________________________________________ > freebsd-fs@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8834bc1f-4e73-4315-a591-a4ff89dc80c9>
