Merge 2 ZVOLs under same pool

hatem5000

Dabbler
Joined
May 16, 2019
Messages
26
Hi folks,

Recently i'm doing some upgrades to my Truenas and i have pool for jails and VMs, this pool contain 2 stripped zvols (each zvol only contain one SSD) and i would like to merge them into 1 HDD zvol as a step to make one mirrored zvol (after buying another HDD)

How can i achieve that through GUI or Shell ?!!

Thanks
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I think you're confusing zvols with VDEVs.

If you get one HDD, create a pool on that, use zfs send | recv (or a replication task in the GUI) to transfer a snapshot of your pool contents (datasets and/or zvols) to it, you can then destroy the existing striped pool of 2 SSDs and rename the new one to match the old one (if you want).

You can later convert your single-VDEV pool to a mirror when you get your second HDD.
 

hatem5000

Dabbler
Joined
May 16, 2019
Messages
26
I think you're confusing zvols with VDEVs.

If you get one HDD, create a pool on that, use zfs send | recv (or a replication task in the GUI) to transfer a snapshot of your pool contents (datasets and/or zvols) to it, you can then destroy the existing striped pool of 2 SSDs and rename the new one to match the old one (if you want).

You can later convert your single-VDEV pool to a mirror when you get your second HDD.

Oh yes i meant vdev :)

Ok, I'm doing this now but how can i make sure that new pool is working alright after replication is finshed (before i move on to destroy the old pool ) ?!

Thx
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
how can i make sure that new pool is working alright after replication is finshed (before i move on to destroy the old pool ) ?!
It depends how you're sure it's working now...

If you're intending to replace the SSD pool completely, you'll need to do the renaming for it to take the place of the original without having to re-do things like shares and jails, etc.

To rename, you'll need to do something like this:

Replicate all data from pool original to pool new

Disconnect/export the pool original (don't remove share configuration or data)

at the CLI zpool import original old

zpool export old (optional)

Disconnect/export the pool new (don't remove data)

at CLI zpool import new original

zpool export original

In the GUI, import the pool original.

At that point all should work as normal (you may need to reboot just to have things start with the pool in the right place).
 

hatem5000

Dabbler
Joined
May 16, 2019
Messages
26
It depends how you're sure it's working now...

If you're intending to replace the SSD pool completely, you'll need to do the renaming for it to take the place of the original without having to re-do things like shares and jails, etc.

To rename, you'll need to do something like this:

Replicate all data from pool original to pool new

Disconnect/export the pool original (don't remove share configuration or data)

at the CLI zpool import original old

zpool export old (optional)

Disconnect/export the pool new (don't remove data)

at CLI zpool import new original

zpool export original

In the GUI, import the pool original.

At that point all should work as normal (you may need to reboot just to have things start with the pool in the right place).

Thanks .. this worked But i didn't change the name yet .. as i liked the idea of "replication tasks" and i maded auto by linking it to periodic snapshot task ..

So which is better, keeping the old pool backup up by replication task to the new pool OR buying another HDD to make it mirror vdev inside the new pool ?!!

Thanks
 
Top