can you move a dataset from one zpool to another ?

georgelza

Patron
Joined
Feb 24, 2021
Messages
417
Curious, we know the restrictions around zpools and their underlying vdev's...

Any chance you can move a dataset from one zpool to another, with all it's shares and permissions/ACL's in tact.

G
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Of course, although it is not a "move" in the strict sense but a copy. But with all attributes intact, yes.

Code:
zfs snapshot oldpool/dataset@copy
zfs send oldpool/dataset@copy | zfs receive newpool/dataset
zfs destroy oldpool/dataset@copy
zfs destroy newpool/dataset@copy

The last two commands remove the snapshots only, not the entire dataset.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703

seanm

Guru
Joined
Jun 11, 2018
Messages
570
What about a dataset (zvol) that backs a bhyve VM? After the zfs send+recv, can you redirect the VM to the copied zvol? (ex: if you want to move your VMs from a pool of HDs to a pool of SSDs.)
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
What about a dataset (zvol) that backs a bhyve VM? After the zfs send+recv, can you redirect the VM to the copied zvol?
Yes, that's the point :wink:
 

georgelza

Patron
Joined
Feb 24, 2021
Messages
417
Will be creating a small test dataset and trying this out.

have 3 HDD's to add to my NAS, in 2 minds if I should create them as their own zpool and move some of the datasets from the current pool to this one, or if I should add the 3 x HDD's as a vdev to the current pool.

thanks.

G
 

georgelza

Patron
Joined
Feb 24, 2021
Messages
417
... but loving the features, capability that I'm finding.

G
 

hescominsoon

Patron
Joined
Jul 27, 2016
Messages
456
Sorry, I was unclear. What I meant was: where is the UI to repoint the VM to the copied zvol? Do you just edit the "devices" and change the "disk"?
yep
 
Top