by alyandon · 9y ago · 0 comments
"Once you build a ZFS volume, it’s pretty much fixed for life."
The ease of growing/shrinking existing volumes and adding/removing storage is why I made the decision to go with btrfs when I rebuilt my home file server.If you build a volume, you can add more zdevs to it.
My suggestion is to avoid RAIDZx and go with mirrors. To add more storage, just add another pair of drives and add it to your pool.
Here is what my main `tank` looks like:
pool: tank
state: ONLINE
scan: scrub repaired 0B in 4h59m with 0 errors on Tue Jul 4 12:47:02 2017
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
wwn-0x50014ee20eba1695 ONLINE 0 0 0
wwn-0x50014ee20eba337e ONLINE 0 0 0
mirror-1 ONLINE 0 0 0
wwn-0x50014ee2640efb3a ONLINE 0 0 0
wwn-0x50014ee2b964ef3f ONLINE 0 0 0
mirror-2 ONLINE 0 0 0
wwn-0x50014ee2b964f2d5 ONLINE 0 0 0
wwn-0x50014ee2b964f4f4 ONLINE 0 0 0
cache
wwn-0x5002538d704e9ff1-part4 ONLINE 0 0 0
errors: No known data errors
You can simply add another mirrored pair and get more storage. Or, you can update an existing mirror by adding new drives, then removing the old ones. Mirroring has better performance and IOPs than striped raid too. If you feel that mirrors might be less reliable than RAIDZx, I'd suggest you read up about it - generally mirrors are more reliable (and you could mirror 3 drives if you liked, get more throughput and IOPs - or have a hot spare).The more complex answer is that over time as you write more data, ZFS will re-balance the distribution of data over the available zdevs.
[1] if you're not careful, this is actually very likely to happen. If you purchase 2 disks at the same time, and they are under the same usage patterns (which they will be when working in a pair), under the same temperature then they are very likely to die at the same time.
LVM on the other hand makes it easy to do snapshotting, RAID, volume resizing, adding more drives, etc - at the cost of some performance in some cases. For the most part, it's the best trade off available if expandability is a requirement and you can't get away with simple mdraid.
Regardless, I really haven't had any operational problems with btrfs for my 3 TB or so of data and when it has managed to get wedged because it couldn't allocate more space to the metadata pool during the initial import of data from my old array I fixed it with a simple rebalance command.
A cron set up to run a minor rebalance weekly helps ensure you never run into that situation in practice and I've not lost any data so for now I'm comfortable using btrfs as my primary filesystem.
I am a little concerned about the longevity of btrfs in general though because it hasn't been receiving a lot of development work lately.
?
Doesn't ring a bell.
A lot of problems with Btrfs sounds like hardware problems of one sort or another. If it's a legit bug the only way such things get fixed is to report it to the developers <linux-btrfs@vger.kernel.org> with complete logs and system information. Did you?
The fsck is definitely hit or miss, but my perspective is the emphasis is on fixing bugs that obviate file system problems in the first place. The reality is an offline fsck for large file systems is just not scalable, so the best bang for the buck is bug squashing.
And there's a tons of that happening.
For the initial 4.12 pull (now done, and probably had a few dozen changes during rc's) 40 files changed, 1629 insertions(+), 834 deletions(-) https://lkml.org/lkml/2017/5/9/510
For the initial 4.13 pull 47 files changed, 1707 insertions(+), 1400 deletions(-) https://lkml.org/lkml/2017/7/4/436
It happened to me while on vacation -- I only had satellite internet and had to fix it over ssh at single characters per second.
It might have to do with a bug I saw mentioned on the list that referred to the free space map getting corrupted (but easily fixed with a -oremount,clear_cache). So I also run that monthly as well.
I've been too afraid to remove the cron job even though I moved my CentOS7 to the "mainline" kernel rpms from http://elrepo.org
Also, I only trust RAID1 + Crashplan.
https://btrfs.wiki.kernel.org/index.php?title=RAID56&diff=30...
There is a huge performance penalty of course, as all the majority of new data will reside on the latest vdevs - but it generally works.
I do agree this is one of the largest drawbacks of ZFS, but very few filesystems get it right.
As long as they're expensive mirror vdevs, right? My impression is that home users want the efficiency of RAID-6 and they want incremental expansion (regardless of whether this combination is "good for them"). ZFS can't do that.
For a 6x8TB and assuming a (optimistic) 10^-16 URE, you get 3.5% failure rate for a RAID5 array, 0.7% for a RAID10 array and a 1.06e-08% failure rate for RAID 6.
Why be greedy for all that performance? Most home-grade NAS or even some business-grade NAS isn't used for performance sensitive operations, more like Word Documents and Family Pictures, stuff you don't want to loose.
I'd rather take safety over performance here.
I'd love to run ZFS, but I can't because I need to be able to add more drives as I buy them.
But it doesn't look like there's been any movement on an implementation and it seems like it's high effort and mostly home users who want this, not enterprises who might be willing to pay for.
Ah well, guess I'll stick with mdraid for now.
You could also add another raidz vdev if you have the space in the server, eventually they should level out depending on workload.
"Best" solution, read most expensive, would be to copy the data over to a new server you've configured for the new load/capacity.
Both have high investment costs for something a plain mdRAID, snapRAID or LVM RAID can achieve far simpler with better results.