Jump to content

How to encrypt existing ZFS drive/Pool containing snapshots


Go to solution Solved by timetraveler,

Recommended Posts

TL;DR: Need guidance on transferring ZFS datasets and snapshots from an unencrypted drive to an encrypted one.

 

Context:

  • I've successfully converted a cache SSD and HDD into ZFS following this guide and then setting up nightly snapshots of the cache SSD, replicated to the HDD according to this guide from @SpaceInvaderOne
  • now I aim to encrypt my unraid server. As a test, I've already encrypted one empty drive. works great!

 

Issue:

  • I'm looking to move data from the unencrypted drives to encrypted ones, and then reformat the unencrypted ones and then move the data back (at least for the SSD)
  • Although I plan to follow this encryption guide , my concern is about the ZFS datasets and snapshots present on the existing drives. I'm unsure how the mover tool in the guide would work with these ZFS features as the tutorial didn't feature any of those

 

Request:

  • Should I consider using native ZFS features, like 'zfs send', for this transfer? If so, how?
  • should I perhaps use spaceinvaders replication script to move/copy the data? or syncoid directly?
  • I'd appreciate any advice or tips on this process.

 

note: please ignore the Disk2 in the example screenshot is encrypted-xfs. I am planning to reformat it to encrypted-ZFS

chrome_OxgE4lOu1z.png

Link to comment
  • Solution

Thank you that worked. 

 

This is what i used to move the data:

take a snapshot of all datasets

zfs list -H -o name -r poolname | while read dataset; do zfs snapshot "${dataset}@snapshot_name"; done

transfer

zfs send -R -v cache@snapshot_transfer | zfs receive -F disk2

 

also make sure there are no regular folders on the root level!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...