Best way to migrate data to encrypted pool?

All your general support questions for OpenZFS on OS X.

Best way to migrate data to encrypted pool?

Postby roemer » Wed Jul 04, 2018 5:20 am

What is the best way to migrate an existing (unencrypted) ZFS dataset to an encrypted ZFS dataset?
I tried zfs send/receive, but get only an error message that the encrypted dataset cannot accept an unencrypted data stream.
Code: Select all
  zfs send -ceLv src/myfiles@migration | zfs recv -s replica/encrypted/myfiles
       ...
     cannot receive new filesystem stream: incompatible embedded data stream feature with encrypted receive.

Am I missing something? Or do I have to use a standard file sync tool such as rsync or ChronoSync for this?
This would be sad because in my experience, zfs send/recv would be much faster...
roemer
 
Posts: 73
Joined: Sat Mar 15, 2014 2:32 pm

Re: Best way to migrate data to encrypted pool?

Postby lundman » Wed Jul 04, 2018 4:02 pm

I think it was suppose to be relying on inheritance?

zfs create -o encryption=on POOL/top
..... | zfs recv POOL/top/recvfs

So recvfs gets encrypted root of "top". Been a while since I played with it though.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Best way to migrate data to encrypted pool?

Postby roemer » Thu Jul 05, 2018 7:57 am

That's what I tried to do in my original command: 'replica/enrypted' was the encrypted destination dataset, of which 'myfiles' should become a sub-dataset, inheriting the encryption property...

I played around a bit more with two temporary pools on /tmp and the following seems to work:
Code: Select all
 zfs send -Lv src/myfiles | zfs recv -sv replica/encrypted/myfiles

Apparently neither the '-R', the '-p' or the '-e' flag can be used on the send side, and no '-F' on the receive side.

There is a discussion about this on the ZOL GitHub, but the solution is a bit hidden within all the messages (cf. comment from tcaputi from 1 Nov 2017 and from aarononeal on 12 Feb):
https://github.com/zfsonlinux/zfs/issues/6793
roemer
 
Posts: 73
Joined: Sat Mar 15, 2014 2:32 pm

Re: Best way to migrate data to encrypted pool?

Postby lundman » Thu Jul 05, 2018 4:16 pm

I caught up with all the zfs send --raw and encryption commits yesterday in master, should they have fixed something
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan


Return to General Help

Who is online

Users browsing this forum: No registered users and 23 guests