Increasing Capacity

JaMu

Dabbler
Joined
Jul 31, 2016
Messages
30
Hi all,

I apologize if this has previously been answered but I haven't been able to find the answer. I need to increase the capacity of my FreeNAS. I am currently running a 6 disk RAIDZ2 pool and will be adding 2 more drives to make it a 8 disk RAIDZ2. I know that this cannot be done without destroying the current pool and creating a new 8 disk RAIDZ2 pool. I have a backup of all the data in preparation for this task.

My question is, once I have created the new pool, can I reuse my existing datasets and associated shares, and will my existing permissions be maintained? I am trying to avoid having to reconfigure all of the varying permissions I have setup on the shares and sub folders after I migrate the data back to the FreeNAS. Most of the permissions that I have configured have been applied to the folders through Windows.

I would appreciate any help or guidance that anyone can offer.

Thanks.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
No, creating a new pool means destroying the old pool. What would work better for you is to replace each drive in your 6-disk RAIDZ2 pool with a larger one, and resilver after each replacement. Once all 6 disks are replaced, your pool will expand to accommodate the larger disks.
 

JaMu

Dabbler
Joined
Jul 31, 2016
Messages
30
@Samuel Tai Thanks for your quick reply. Unfortunately, replacing the existing disks with larger ones is not an option for me at this time so I will need to complete whatever steps are necessary to destroy and rebuild the pool. Is my only option to through the FreeNAS interface and note down the current configuration for my pool, datasets and shares, as well as capturing the permissions I have configured in Windows, and then manually recreating those once the new pool is created?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Is my only option to through the FreeNAS interface and note down the current configuration for my pool, datasets and shares, as well as capturing the permissions I have configured in Windows, and then manually recreating those once the new pool is created?
Well, no. You have another option.

Since changes to pool geometry are permanent for the pool and mostly not related to config, you can probably get away with saving the config, destroying the pool, creating a new pool (with exactly the same name), export the new pool, then re-import the config and maybe you will need to import the pool again in the GUI (maybe it will just be picked up).
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
@sretalla, I thought about that, but I don't think the config saves the dataset structure. I think it assumes the pool keeps that safe, since that's usually the case with a reinstall.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I don't think the config saves the dataset structure
Indeed it doesn't, that's in the pool too, but I didn't mention that you would clearly need to put your files back after rebuilding the pool... so add the step to zfs send | recv the data off to another location and then back again recursively to avoid losing your data and its structure.
 

JaMu

Dabbler
Joined
Jul 31, 2016
Messages
30
Thank you both for your input. I'm not sure if it make a difference to the process that you are suggesting, however, I think it is worth mentioning, the backup copy of the data that I have, and will be using to restore the data to the FreeNAS once I rebuild the pool, is not stored on a second FreeNAS, (it's on a Windows Storage Space). Just in case this has any impact on how the dataset information is stored on the pool.

So the process as I understand it would be;
  1. Save a backup copy of the config from the FreeNAS GUI
  2. Destroy the pool
  3. Create a new pool with the additional drives and name it the same as the previous pool
  4. Copy the data from my backup to the FreeNAS, (I was planning on using RoboCopy). However, how will I copy the data there as the shares are contained in the datasets which have not been recreated at this point?
  5. Export the new pool, (I'm not quite sure why)
  6. Restore the FreeNAS config from the backup file saved in step 1
  7. Import the pool, (if this did not happen during step 6)
I would appreciate any further input you can provide. Has anyone previously gone through a similar process? How did you handle it?

Thanks.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Copy the data from my backup to the FreeNAS, (I was planning on using RoboCopy). However, how will I copy the data there as the shares are contained in the datasets which have not been recreated at this point?
I would start by saying that in order to get your datasets back, you will need a backup that's on ZFS also.

You could create that via replication task or with zfs send | zfs recv to get a recursive snapshot to the target. (if you want to share the actual paths, I can try to put the exact syntax in a few lines for you)

Once you have it and have re-created the pool the way you wanted, you can reverse the zfs send | recv with the target being the recreated pool.

If you do that before the config restore, it should not even miss a beat with shares/jails.
 

JaMu

Dabbler
Joined
Jul 31, 2016
Messages
30
@sretalla Thanks for getting back to me and also for the offer of helping with the syntax, greatly appreciated. Unfortunately I don't have the option for the backup to be on ZFS at this time, (that's a point I'd like to get to). The backup destination is just a collection of external USB drives connected to a PC in a parity group using Storage Spaces. It's not ideal but it is better than nothing for now.

From what you have said it looks like I will just need to go through the process manually. So my process will be, recording the configuration of my datasets and shares, as well as capturing the permissions I have configured in Windows, destroying and creating a new pool, reconfiguring the datasets and shares, restoring the data and then reconfiguring the permissions.

Let me know if that seems accurate or if there is a better way of achieving this with my current constraints.

Thanks.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Let me know if that seems accurate or if there is a better way of achieving this with my current constraints.
I would keep everything in the previous plan, just note your dataset structure and recreate that before using rsync or robocopy to put the data back.

zfs list should give you something to work with and you could copy/paste to zfs create commands to put it back.


I even had a look and made a (very quick and dirty) scripted way to do it. (assumes no spaces in dataset names)

Before destroying the pool, run:
zfs list | grep -v boot-pool | awk -F " " '{print $1}' | grep / > datasets.txt

optionally look at and clean up datasets.txt (and save it somewhere).

Then after creating the new pool:
while read line; do zfs create "$line"; done < datasets.txt

Then you should have all your datasets back.
 
Last edited:
Top