How to remove a zpool and transfer all data

Status
Not open for further replies.

shackrock

Explorer
Joined
Dec 21, 2011
Messages
95
Hi all,

I have 2 Zpools. My storage needs have decreased (as far as capacity goes), and I'd like to eliminate one of the zpools, but make sure all data is safe in my other zpool before doing so of course.

Is there a way to do this in the freenasGUI? Thanks!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Removing the zpool is easy--just go to the Storage screen in the web GUI, click on the pool, and click the "Detach Volume" button at the bottom (it's the button with the red X). Make sure the .system dataset is set to be on the pool that will remain.

I'm not aware of a way to move the data through the web GUI. ZFS replication would definitely do the job, but the replication screen in the web GUI seems geared to replicating to/from a remote system. You could do replication at the command line, rsync, or just a bunch of cp's.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Hi all,

I have 2 Zpools. My storage needs have decreased (as far as capacity goes), and I'd like to eliminate one of the zpools, but make sure all data is safe in my other zpool before doing so of course.

Is there a way to do this in the freenasGUI? Thanks!

Console or shares only. Or perhaps a file manager in a jail. You can't do file management from FreeNAS' GUI.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
You can use the shell from the GUI and use the "cp" copy command. This is the fastest way to transfer the data if you have a large amount, otherwise if this is too much of a headache I'd use CIFS and start a transfer and let it go. BTW, if you have never used the shell, play it safe and use CIFS to move your files.
 

shackrock

Explorer
Joined
Dec 21, 2011
Messages
95
Maybe I should have clarified, both ZPools are part of the same ZFS Volume... that is:

VOLUME: MyNAS
Zpool1: 4 Drives in RAID-Z1
Zpool2: 4 Drives in RAID-Z1

My data would fi ton a single Zpool, so now I just want to switch to only Zpool 1 and deactivate/remove the drives from Zpool2.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I would recommend you copy the data over by whatever means you feel comfortable using and then detach the volume you no longer want to use.
 

shackrock

Explorer
Joined
Dec 21, 2011
Messages
95
I would recommend you copy the data over by whatever means you feel comfortable using and then detach the volume you no longer want to use.

But what do I copy too? Both zpools are "clustered" together in the same volume. So I can't forceibly make one of the 2 zpools empty by any means that I am aware of. The data is spread accross both anytime I drag into the folder via CIFS.

You're saying I need to copy all data to external drives, destroy the volumes, recreate a volume however I see fit, then copy everything back over afterwards?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Sorry I wasn't clearer, my fault entirely.

As you said, you will have to copy all the data off to some other storage, destroy the pools (mark the disks as new option), recreate them (recommend RAIDZ2) and then copy the data back.

It can be a slow process if you have a lot of data.

I'll be doing something similar when 9.3 Release comes out... I'll be recreating my pool as I can drop one drive for certain, maybe two drives. My storage needs are not even close to what I anticipated. I plan to leave the drives installed but with the power cable disconnected so when I need to replace a drive for failure, it's ready to go.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Maybe I should have clarified, both ZPools are part of the same ZFS Volume... that is:

VOLUME: MyNAS
Zpool1: 4 Drives in RAID-Z1
Zpool2: 4 Drives in RAID-Z1
The reason for the confusion is that you're using the terms incorrectly. What you have there aren't zpools, they're vdevs, and your volume (MyNAS) is one zpool. No, you cannot remove one vdev from a zpool; once it's been added it can never be removed. If you want to remove those disks from your server, you will need to back up your data, destroy the pool, and recreate it using only the disks you want to use. Then restore the data.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
But as joeschmuck said, you would be wise to take the opportunity to recreate your volume as Raidz2. Much safer than the Raidz1 setup you have now.
 
Status
Not open for further replies.
Top