moving a zfs pool

Bernd Walter ticso at cicely12.cicely.de
Sun Jul 8 00:23:22 UTC 2007


On Sun, Jul 08, 2007 at 12:34:17AM +0200, Volker wrote:
> Hi,
> 
> this is more likely currently a theoretical question: How does one
> move a zfs pool from one machine to another?

on old machine: zpool export foo
attach disks to new machine
on new machine: zpool import foo

You can also do zpool import without parameter to list pools available
to import.
You need to "zpool import -f foo" on the new machine to force the
import in case you hadn't exported it on the old machine.

> I've done that in the past a lot with ufs filesystems by piping a dump
> through an ssh session and restoring on another machine just to move
> data to another system. This should also work on a per filesystem
> basis when using zfs but isn't there a way to move the whole pool to
> another machine (w/o physically moving the hard disk)?
> 
> This would be the case when migrating a machine or migrating hard
> disks. The zfs export feature doesn't look promising for this or do I
> misread some bits? Please don't tell me, 42 is the answer... ;)

You misread :)

> I'm missing something I would call 'zpool dump' and 'zpool restore'.

There is none :(
But you can zfs send/receive at filesystem/volume level.
It seems that you can trust the zfs list order on snapshots when
copying multiple/all snapshots.
Unfortunately things become more complex if you want to save clone
data - especially to keep common stored blocks - as well.

-- 
B.Walter                http://www.bwct.de      http://www.fizon.de
bernd at bwct.de           info at bwct.de            support at fizon.de


More information about the freebsd-current mailing list