Migrating a pool from one vdev to another on the same box - easiest way?

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
I currently have a Raid-Z2 array of 5 4TB disks, and it is starting to fill up. I'd like to replace it with a new Raid-Z2 array of 4x10TB. I have plenty of SATA ports...

The most common recommendation I have seen is to create a new pool and use zfs send / receive to replicate the data. If that's my only option, that's fine, but there's some manual work there, and then I'll need to clean up all of my shares to point to the new pool instead. Is there a way to just have two vdevs in FreeNAS, use the UI, and tell it to "move" the pool from one to another? Then it resilvers, and I'm done? Or is the zfs send / receive option the best? Thanks!
 

MikeyG

Patron
Joined
Dec 8, 2017
Messages
442
I don't think there is a GUI option for migrating pools, or in this case the datasets on those pools, unless you do a snapshot replication task which is the equivalent of zfs send/receive.

If you want to preserve the pool name the datasets are on along with the shares, you could try creating a new pool with a new name, transfer the datasets, then rename the new pool to match the old one.

I've tested this process out and it worked for me:

Export pool from GUI
From CLI, 'zpool import oldname newname'
From CLI, 'zpool export newname'
Import pool from GUI
Fix all your shares and anything else dependent on the path to the old pool.


Do a manual snapshot on the parent dataset, and then a zfs send -Rv OldPool/ParentDataset | zfs receive NewPool/NewDataset
Detach old pool
Rename new pool

Should be good.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Is there a way to just have two vdevs in FreeNAS, use the UI, and tell it to "move" the pool from one to another?
No--vdevs are always part of a pool; they don't exist independently of the pool. If you'd get a fifth 10TB disk, you could expand your pool by replacing one disk at a time. After you replace all the disks, your pool will expand to use the available space.
 

thinkbsd

Cadet
Joined
Mar 7, 2020
Messages
3
Newb here. I currently have 16 x 2T drives. I created one pool with 2 vdevs with 8disk in each vdev. Now the pool is low on space I've purchased 8 x 8TB drives to replace one of my vdev.

Are you saying that I can pull each of those drives that make up one of the vdevs and after I add the 8th one the pool will auto-expand ? Do I have to evacuate the data on the vdev prior to replacing the drives?
 

garm

Wizard
Joined
Aug 19, 2017
Messages
1,556
Are you saying that I can pull each of those drives that make up one of the vdevs and after I add the 8th one the pool will auto-expand ?
Yes
Do I have to evacuate the data on the vdev prior to replacing the drives?
No

but always you need solid backups of your data, it’s at risk just sitting on the server, risk goes up exponentially when you start messing around with it.
The manual explains the procedure for drive replacement, just that, if you have the space, I would recommend to keep the drive being replaced in the pool during resilvering to retain redundancy
 

thinkbsd

Cadet
Joined
Mar 7, 2020
Messages
3
Yes

No

but always you need solid backups of your data, it’s at risk just sitting on the server, risk goes up exponentially when you start messing around with it.
The manual explains the procedure for drive replacement, just that, if you have the space, I would recommend to keep the drive being replaced in the pool during resilvering to retain redundancy

When you say “I would recommend to keep the drive being replaced in the pool during resilvering to retain redundancy” can you elaborate ?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
When you say “I would recommend to keep the drive being replaced in the pool during resilvering to retain redundancy” can you elaborate ?
If you have space for a seventh disk in your system, you can do the disk replacement without taking the original disk offline--the system will offline the old disk when the resilvering is finished. Doing it this way avoids any loss of redundancy while you're working on this.
 

thinkbsd

Cadet
Joined
Mar 7, 2020
Messages
3
Ahh that makes sense unfortunately I have populated all 16 slots on my server so that’s not an option. I have both my vdevs in the pool using Raidz2 which I believe allows for a disk failure in each dev.

Can I use that extra drive in this situation .
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
Ahh that makes sense unfortunately I have populated all 16 slots on my server so that’s not an option. I have both my vdevs in the pool using Raidz2 which I believe allows for a disk failure in each dev.

Can I use that extra drive in this situation.
RaidZ2 will allow for 2 drives to fail without data loss. Good choice on Z2:)

I have done this many times. Works like a charm. Offline a disk in your vDev, replace it with a larger drive and resilver. Do this until all 8 smaller drives in a single vDev are replaced and BLAMO, the pool will automatically expand. You might want to quickly verify that your pool has the autoexpand setting set to on. Check this with zpool get autoexpand mypool. If it is not on, you can set it with zpool set autoexpand=on mypool

This does take some time but it works great.

And for the quick PSA - RAID does not equal BACKUP :D

Cheers,
 
Top