Replicate and delete?

bar1

Contributor
Joined
Dec 18, 2018
Messages
115
Hi,
I am building a new NAS and i need to move all the data from 1 drive to another.
is there a way to replicate and delete?
what is the best way to move a dataset to another drive?
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Hi,
I am building a new NAS and i need to move all the data from 1 drive to another.
is there a way to replicate and delete?
what is the best way to move a dataset to another drive?
With ZFS you replicate data from one pool to another pool. If necessary, you can make a single drive into a pool, but typically its a set of drives. After replication, you can delete the original dataset.

You can also import a drive with non-ZFS data: https://www.truenas.com/docs/scale/scaletutorials/storage/disks/importingdisks/
 

bar1

Contributor
Joined
Dec 18, 2018
Messages
115
thanks i am doing it, was looking for a straightforward zfs move, but will just replicate and delete thanks
 

jct

Explorer
Joined
Aug 14, 2021
Messages
52
Ah. I agree that your case is unusual and hints at mistaken impressions of zfs that you may come to regret. BUT if you’re trying to replace a single-drive pool in place with another single-drive pool of equal or greater size, then — if only to reduce downtime — you would indeed have had a remaining trick to play.

The idea would have been to join the second drive into the pool’s single mirror vdev, and wait for the pool to resilver and stabilize. Then remove the initial drive from the mirror. Then if necessary, tell the pool to expand to take up any additional space made available beyond the size of the former drive.

Replication or straight file copies can work too, and might fit better with your current understanding of zfs. Replication is preferred over a straight userland copy, due to the possibility of a flipped bit in transit which could evade detection.

A mirror rebuild and decoupling would have kept the pool's contents live and in service throughout the entire operation. But that's not a reason to start over if you've got a plan in motion that you trust.
 
Top