Does it make sense to use ZFS for a single volume HDD?

nazgul

Member
Aug 19, 2022
12
1
8
Am in the process of deciding the best disk format for a new external HDD (20TB WD Elements). This is going to be 85% filled from day one, and then managed to around 90-95% over time.

Would it make sense to use ZFS for it? Would it maintain the performance as the drive fills ups?

As reference, I tested this drive under APFS on macOS and its performance is 229/229 r/w when blank, which drops down to 110/110 once 90% full.

Reason I ask is that I've been testing ZFS over the last few months on a separate smaller 2TB 2.5" HDD and I see write speeds decreased to max 10 MB/s or so after the drive is only 50% full. This is likely due to this particular drive being an SMR drive, however, what performance hit could I expect on a CMR drive when nearly full?

Thanks
 
Last edited:
The main question is: what exactly do you want to achieve?

ZFS is a datacenter file system. Not exactly what I would expect for a single, external (USB attached?) disk.
Where ZFS has a lot of strengths is the data consistency piece. You can do scrubs and even detect (silent) bit rod. But what exactly do you do if there is only one copy of your data? You seem not to have planned to mirror the disk?!
Where it does have it downsides: Memory usage/need, file system should not be used above 80-90%

If performance is your own concern I'd probably use a different file system (EXT4).
ZFS is a great Filesystem (I am using it in many places) and still I think it is not the choice for your usecase.
 
I have a 14 TB WD Elements shucked and slot it into an 5,25"/3,5" adaptor for inhouse external backups once a week. It is split into 5 partitions and these are in a raidz1 pool for data integrity. I have also used /dev/disk/by-partuuid/ when building the pool, so the drive can be passthrouged into a vm if needed for example for remote backup, as the source datasets are encrypted.
I do backups on this drive once a week, which is about 100gb write and about the same to delete for old snapshots. This takes up to 2hrs. Snapshots handled with sanoid/syncoid and custom script to prune for this HDD after backup was successful.

So from my point of view, it can make sense :)
 
I am having a hard time to get to the bottom of it.

Either I do not understand your setup correctly or the question does not make sense to me.

Option 1: ZFS-Send/Receive would be an obvious choice for me in such a case. But then why are you asking if ZFS would be the choice - it is a prerequisite.
Option 2: If you are not using ZFS-Send/Receive (you are mentioning sanoid/syncoid) to the external drive then why exactly are you concerned about the performance? 100 GB write / delete of snaps is not exactly a lot - even if it takes an hour or two longer - so what ;).
If main concern is integrity (my point of view on your whole setup) you would need to run regular scrubs on that disk anyways - which will take much longer.

If you are using ZFS on you main storage - use it on the external one.
don't worry about the performance. If the backup is the main purpose of it - go with ZFS, and don't forget the scrubs.

Hope this makes sense :D
 
As already said, 20% of the capacity should always be kept free. So ZFS isn't a good option for you if you plan to fill it up to 95%. Above 80% the pool will get slow and start to fragment faster. ZFS is a copy-on-write filesystem, so you can't defragment it. If you fill it above 90% it will panic and become even slower.
 
I am having a hard time to get to the bottom of it.

Either I do not understand your setup correctly or the question does not make sense to me.

Option 1: ZFS-Send/Receive would be an obvious choice for me in such a case. But then why are you asking if ZFS would be the choice - it is a prerequisite.
Option 2: If you are not using ZFS-Send/Receive (you are mentioning sanoid/syncoid) to the external drive then why exactly are you concerned about the performance? 100 GB write / delete of snaps is not exactly a lot - even if it takes an hour or two longer - so what ;).
If main concern is integrity (my point of view on your whole setup) you would need to run regular scrubs on that disk anyways - which will take much longer.

If you are using ZFS on you main storage - use it on the external one.
don't worry about the performance. If the backup is the main purpose of it - go with ZFS, and don't forget the scrubs.

Hope this makes sense :D
I'm not the thread author :D
But as he asked if one HDD makes sense for ZFS, I thought I write my use case for one HDD as backup.
And you're right, I'm using ZFS-Send/Receive and do regularly scrubs.
 
Thanks all for the replies, much appreciated.

I have a few separate backups of this data elsewhere, so covered from that perspective.

The main goal would be to have a way to detect bit rot early and resilience against sudden power loss (which may happen a handful of times a year). I understand ZFS is better than EXT4 on that front. The drive will be always connected, but accessed perhaps 2-3x a week for maybe 5 hours total.

Is there a rough proxy calculation that can estimate the read/write at the point of 90% full? As mentioned, on HFS+ filesystem, I get 110/110 read/write when 90%. I don’t mind losing a further 30% or so to ZFS. Is there a way to quickly tell without me actually filling it up?
 
Last edited:
It will get slower and slower over time as not enough free space causes fragmentation. And only way to "defrag" it, is to move all data off that pool and write it back. So best is to always have 20% of free space so it won't fragment faster in the first place.
Having a second completely free disk to be able to "defrag" wastes way more space than just the 20%...atleast until you want a copy of everything on a second pool anyway for backup purposes. then you could just mirror the pools and from time to time empty an pool and replicate the data back from the other pool.
 
Last edited:
This is going to be 85% filled
How compressible is the data? ZFS is capable of transparent compression, so you may be able to store 17 TB in less space than before. You can also play around with huge recordsizes if you seldomly use the disk as you wrote.
 
Yes, copies=2 uses twice as much space. But with that you at least get bit rot protection (as there is parity data to fix corrupted data). Withour it, you only get bit rot detection when using a single disk as a pool. So ZFS will tell you that you lost data due to bit rot protection, but it can't do anything against it.
 
The author of this thread does achieve something similar by partitioning the single disk into 5 partitions.
Those are getting used in a raidz1 pool. I had to read it twice to get to the point and like this unconventional approach.
It will have its downsides as well (io will suck) and still I like this creativity. I have learned something :)
 
  • Like
Reactions: _gabriel
I'm still not the author xD
It was also not my own idea, some day youtube recommended a video, in there a guy partitioned a HDD to 4 partitions and used them in a raiz1 ZFS pool to have bitrot protection on single HDD and loose only 25% storage for a cheap backup.
It's also possible to make 8 partitions and loose only 12,5%, but this would also increase the risk of data loss in case of 2 errors on needed sectors.
Homelabbing is fun! :D
 
Ah...yes thats creative. Benchmark of such a single HDD raidz1 would be interesting.
 
And the author of this thread decided ZFS may not be worth given the amount of data :).

Might revisit the idea of using ZFS later on with a larger HDD or multiple SSDs in a year or two.
 
Ah...yes thats creative. Benchmark of such a single HDD raidz1 would be interesting.
Yes, interesting idea, but it'll be horribly slow.

As always with RAID: copies=2 will be the fastest way (it's a mirrored approach), but will waste the most diskspace. Increasing the parition numbers (# disks) will increase the space usage but will slow things down by the number of partitions (#disks).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!