[OpenIndiana-discuss] Antwort: Transferring everything in one zpool to be a subtree in another larger zpool

Hans J. Albertsson hans.j.albertsson at gmail.com
Tue May 5 08:27:18 UTC 2015


I should have put this in the subject; the receiving zpool is on a 
FreeNas 9.3 box.

When I did as described by you, i e "zfs send -R pool/name at snap | ..."
the resulting dataset on Freenas didn't really work.
When trying to set up a share for the dataset on Freenas, I got 
"unsupported share protocol:1" and sharing failed.

It seems this has to do with zfs properties and the fact that ZFS has 
hooks in the kernel in OI but not in FreeNas.

I'm guessing that just doing a "zfs send pool/name at snap", i e not using 
-rp or -R, will make a working dataset on FreeNas which can then be shared.

I'll get back with a HowTo if I succeed or a warning if I don't.

As a side note; just piping to ssh is excruciatingly slow, using netcat, 
"nc", speeds things up at least 4fold.

On the receiving end:

nc -w 600 -l 8023 | zfs recv pool/name

and on the sending end

zfs send pool/data at snap|nc -w 20 receive-address 8023



On 2015-05-04 10:25, Thorsten Heit wrote:
> Hi,
>
>> I have this old machine running oi151a7 with a zpool containing a set of
>> filesystems used for media files of various types, and I want to
> transfer
>> them all, in one go, safely but not unnecessarily slowly, to a new zpool
> on
>> a different machine.
>>
>> The old zpool is on a 2tb two-disk mirror on the oi151a7,  while the new
>> zpool is a freenas raidz2 of 12tb or so actual data space.
>>
>> I want your advice on what is the correct, safest and/or most practical
> way
>> to do it.
>>
>> Both machines are on a GB network, and neither of them will be doing
>> anything else while transferring the data.
>>
>> I'm guessing zfs send/recv over the network, using nc for buffering, but
>> I've never done this before, so please advice me.
>
> Quite easy with zfs and a little time for the sending/receiving process:
>
> 1) Create a snapshot of the pool you intend to move:
>
> root at oldmachine:# zfs snapshot -r <oldpool>@<snapshot_name>
>
>
> 2) Send the pool to your new machine:
>
> root at oldmachine:# zfs send -R <oldpool>@<snapshot_name> | \
>      ssh root@<new_machine> '/usr/sbin/zfs receive <newpool>/<new_name>'
>
> "-R" creates a replication stream package that sends everything
> recursively up to the named snapshot, including properties, snapshots,
> descendent file systems and clones.
>
> If you're not interested in older snapshots, use "-rp" instead of "-R"
> whereas "-r" creates a recursive stream package and "-p" tells "zfs send"
> to include properties.
>
>
> 3) Have a coffee or two and wait :-)
>
>
> 4) Optionally move the received zfs filesystems, volumes, ... one level up
> in your new pool:
>
> root at newmachine:# zfs rename <newpool>/<new_name>/<filesystem1>
> <newpool>/<filesystem1>
>
>
> I have done this several times in the past without problems. You could
> optionally compress the stream with gzip and uncompress it when receiving:
>
> root at oldmachine:# zfs send -R <oldpool>@<snapshot_name> | gzip | \
>      ssh root@<new_machine> '/usr/bin/gunzip | /usr/sbin/zfs receive
> <newpool>/<new_name>'
>
>
> In my experience with some 100GB of data this took far longer in our LAN
> than the same without compressing although the sending and receiving
> machines should have been fast enough...
>
>
> If you don't want to send the whole pool, replace "<oldpool>" above with
> the file system / data set you're interested in; the commands stay the
> same.
>
>
> Best regards
>
> Thorsten
> _______________________________________________
> openindiana-discuss mailing list
> openindiana-discuss at openindiana.org
> http://openindiana.org/mailman/listinfo/openindiana-discuss




More information about the openindiana-discuss mailing list