what is the "correct" way to "replicate" mem stick with ZFS on it?

Matt Churchyard matt.home at userve.net
Fri Aug 16 13:56:24 UTC 2013


> hi all,
>
> please, advice
>
> what is the "correct" way to "replicate" mem stick with ZFS on it?
>
> what I mean:
>
> we have mem stick with ZFS pool `mypool' on it
>
> how to get copy of the mem stick (including the name of the pool)?
>
> - `zfs send ... | zfs receive ...' ?
>
> is not what will help untill pool names
>   on both mem sticks are the same (it is not what I want)
>
> - to make mirror and to detach second mem stick after resilvering?
>
>   I have bad experience with detaching (perhapse I do it wrong way)
>
> - dd ?

I personally would be wary of completely cloning the filesystem due to 
it having completely identical GUID's etc. I'm not sure how the system 
will behave when given two disks with identical pools. You may be OK if 
you don't import the pools and there's no chance of two of the mem 
sticks being in the same machine again.

Obviously dd should work to completely clone the memory stick. You 
could also use dd to create an image file of one memory stick and use 
that in future to provision other memory sticks.

Detach is not a possible choice as it literally removes the device from 
ZFS, so that device is not marked as part of a ZFS pool anymore.

You could attach the new device as a mirror, then use the 'zfs split' 
command to split the second mem stick off into a new pool. This will 
require the new pool to have a unique name though, as with the ZFS 
send/recv option. Personally I would prefer one of these options, and to 
then use 'zpool import new-pool-name required-pool-name' to import the 
pool with the correct name when beginning to use it.


More information about the freebsd-fs mailing list