[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
Mon May 4 15:09:43 UTC 2015


Thanks, that was exactly it.

To add a few bits of info:

You first must get a pair of private/public keys

ssh-keyget -t rsa

for the OI user to run the zfs send.

Then copy the public key from ~/.ssh/id_rsa.pub  on OI to the user root 
(or other user with admin privs) on freenas.
In the web mgmt gui on freenas, click Account->view-users->root
and click "edit" at the bottom. Put the contents of your .pub key into 
the public key field of the edit form.

To test run

ssh root at freenas_address ls

When it works, run

pfexec zfs send -R Tank/dataset at snapshot | ssh root at freenas_address 
'/sbin/zfs recv Tank/Media/name'

on OI
zfs on freenas is in /sbin,

I suppose you could use password login for root on freenas, but freenas 
is set up to use rsa key controlled login for "replication". So this way 
probably has been tested a lot more.


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