Adding 2 Drives to a 4 drive pool

Pmikeyreid

Dabbler
Joined
Jul 12, 2023
Messages
11
Hi Folks,

First off, apologies if this has been asked and answered but all I could find was this post from 2020 and I thought it might be worth seeing if there is an update.

I am relatively new to this and am running my first TrueNAS machine that I've cobbled together from old parts and Marketplace finds. Here are the specs:
Motherboard: A880GU3
Memory: 8GB RAM (the max for that motherboard)
Storage: 4x2TB Hard Drives (Various brands, I know it's not ideal) - I also have a separate SSD for the boot disk.
TrueNAS Scale version: TrueNAS-SCALE-22.12.2.

I am currently running everything mirrored, so I have about 4TB of useable storage.

My question is this: Can I add 2 more 2 TB hard drives to my pool without having to rebuild everything?

I know that the best way to increase storage is just to add the same number of drives again to a different vdev and then add it to the pool, but unfortunately I don't have enough SATA ports to support 8 drives. I was hoping that since I am adding 2 more similar drives (which i would also mirror) that it might work ok, especially since my current pool isn't actually 1 vdev with 4 drives, but 2 vdevs with 2 drives each. (picture of the current config below)

Screen Shot 2023-07-12 at 9.45.51 AM.png

So what do we think? Can i just add the 2 more drives, make another vdev and add it, or do I need to recreate the storage pool?

Any thoughts would be much appreciated.

Thanks so much

Mike
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
So what do we think? Can i just add the 2 more drives, make another vdev and add it, or do I need to recreate the storage pool?
Yes.

Storage | Manage Devices (for that pool) | Add VDEV.

You would perhaps also want to consider a rebalancing, either by emptying the pool and putting the content back (from backup or whatever), moving data to new datasets, deleting old and renaming back to original, or running the in-place rebalancing script: https://github.com/markusressel/zfs-inplace-rebalancing
 
Joined
Oct 22, 2019
Messages
3,641
Unfortunately, rebalancing works against existing snapshots. (The snapshots will hold the records of the "pre-balanced" data.) I don't think rebalancing is as practical or needed for ZFS as it would be for other filesystems and arrays.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
If you want all 3 VDEVs to be involved in read operations for existing content, it's a must-do.

If you want the allocation of new content to not be skewed mostly to the new/empty VDEV, it's a must-do.

If you were just adding the VDEV to get more capacity and don't care about performance, forget it, no problem.
 
Joined
Oct 22, 2019
Messages
3,641
You'll have to say goodbye to all your snapshots though. If you hold on to your snapshots, you've already doubled the used space on the pool. If your pool contains 4 TB of data before the rebalance, then it will contain, at minimum, 8 TB of used space after you rebalance if you have any snapshots. That's a large ask to "start all over again with your snapshots".
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
ZFS will prioritize writes to the empty VDEV, eventuallly balancing by itself with time.

It's the OP's choice whether to prioritize performance (by manually rebalancing) or stability/snapshots.
 

Pmikeyreid

Dabbler
Joined
Jul 12, 2023
Messages
11
Thanks so much @winnielinnie @Davvo and @sretalla. This is just a fun little home project to store some files and run a plex server, so really I'm just looking for the extra storage. I think my biggest performance bottleneck right now is my 8GB RAM limit anyways, but I'm not quite in the place where i'm willing to invest in a new motherboard/processor just yet. As for snaphots, I'm very much still figuring those out so I will just wait until the new drives are installed and use the ones from that point forward, I can't see me needing to go back in time to recover things right now.

I am curious about the rebalancing script though, is that a risky endeavour? If so I'll just leave it, but I do love a little optimization project......

Thanks again.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
The rebalancing script that exists (and I would love to be corrected) is Core only. Doesn't work on Scale

What you can do is ZFS send | ZFS recv each dataset, destroy the original dataset and rename the new one - depending on the relative size of the datasets this will help - but isn't perfect
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
I am curious about the rebalancing script though, is that a risky endeavour?
If properly understood, no specific risks.

As documented on the git page, you'll need to consider your snapshots (and remove them) if you want to see immediate benefit from running the script and/or don't have sufficient space to hold both a snapshot copy and a new copy of all data involved.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
The rebalancing script that exists (and I would love to be corrected) is Core only. Doesn't work on Scale
I think it will work on both. It's a bash script that uses tools that should exist on both.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
Further research says there is a modified script that should work - but the original does not as it uses bc (whatever that is).

There is a pull request - but it shows no sign of being merged for whatever reason

When I run the script on some test data - it barfs with permissions errors. I am running as root
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
The rebalancing script that exists (and I would love to be corrected) is Core only.
Which is the version of TN the OP should use given his 8GB of RAM, imho.

I am curious about the rebalancing script though, is that a risky endeavour?
It basically rewrites all your files. Not risky imho.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Further research says there is a modified script that should work - but the original does not as it uses bc (whatever that is)
True enough, it's a one line change, so easy to do.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
but the original does not as it uses bc (whatever that is)
The standard Unix "basic calculator". A tool to perform math - interactively or in shell scripts.

Does Linux not have this? I hate Linux with a passion for not coming with all basic utilities. Troubleshoot something on a customer owned machine. tcpdump? Not found. man? Not found. Etc. It's driving me up the walls.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
apparently printf can do the job in bash on both platforms, so probably the replacement in that case, but it's also completely unnecessary in that script, so can just be removed from use and it works fine.
 

Pmikeyreid

Dabbler
Joined
Jul 12, 2023
Messages
11
Thanks again all, this has been a great bit of learning. I started on core, and in hindsight agree it would have been the better platform. When I was doing my initial learning though, all the best tutorials I found were Scale based, so I made the switch. At this point things are working well enough and going back to Core would be a big hassle. I think I'll just leave things as they are for now, let things rebalance naturally as I use the system and keep an eye on marketplace for a new motherboard/processor upgrade.

This has been my first adventure into the forums, and I have to say you folks couldn't have been more helpful.

Thanks so much!
 
Top