Solved Why use zfs when ufs will do ?

I've been happily using 13.2-RELEASE for a while, with ufs filesystem
Now planning to setup a fresh14.0 system on some old~ish hardwares, likely a combination of modest SSD and a single spinning drive.
14.0 system will just be used for a simple desktop, and various small projects.
Most likely I won't be needing or using any of the fancy or sophisticated features of zfs.
Am I missing any compelling reasons to implement zfs, rather than ufs, for this use case ?
 
Snapshots, cloning, error checking and (if you have the redundant data) error correction. Lots of reasons to use ZFS.

That said, nothing wrong with good old UFS. And in some cases I would prefer UFS (memory constraints for example).
 
I use ZFS even on single device systems for Boot Environments (root on ZFS). It makes upgrading and potential rollback very easy. freebsd-update will detect and create a BE that is pre-upgrade before actually doing the upgrade.
You need to be aware of this and make sure you "bectl list" every now and then to keep them under control.
 
I use ZFS even on single device systems for Boot Environments (root on ZFS). It makes upgrading and potential rollback very easy.
This. There are many reasons to use ZFS, but if you’ve ever completed an update and then had an “oh, darn” moment, you’ll understand why boot environments are worth the “price of admission” to using ZFS.

Add in automated (periodic) snapshots, and you’ve got a ~versioned filesystem. What did you change in the last day that made something stop working? Let’s ask the filesystem what changed. With sysutils/zfstools, for example.
 
The ability to actually mount a BE (bectl mount) is very useful to recover configuration if you break things.
 
On the other hand, to contrast the advice given here, if you don't ever want to think about storage, UFS is the option for you. Lots of advantages to ZFS, but you have to maintain it in order to take advantage of it.
 
On the other hand, to contrast the advice given here, if you don't ever want to think about storage, UFS is the option for you. Lots of advantages to ZFS, but you have to maintain it in order to take advantage of it.
I don't understand this. UFS you have to partition the device, each filesystem is limited to the partition it is on. That takes a lot more thinking and planning than ZFS where you may have a boot partition and then "rest of device" partition, followed by datasets.

I'm not against UFS; I've used it and still do when it's the appropriate solution (I like it for external devices like USB devices for backup. Explicitly mount, use, explicitly umount). But for daily driver systems ZFS on a single device works fine.
 
Compression and deduplication haven't been mentioned.
Compression is always interesting. "In days of yore" systems here memory and cpu limited, I/O bandwidth was bigger. Then Moore's law started to catch up. Nowdays, there is excess CPU and RAM power/bandwidth but the I/O to devices is the limiting factor. Enter Compression. Spin a few CPU cycles, use some RAM and all of a sudden we can shove more data across the I/O pipeline to the device. Yes, we pay on reading the data back, but we have extra CPU sitting idle otherwise.
Compression lets us take that "SATA-3 at 6Gbps" and push an effective 12Gbps across the pipe (assuming 12Gb compresses to 6Gb). (numbers pulled up out of the ether, not based on actual measurement or real data).

Dedup is another tradeoff.
 
I don't understand this. UFS you have to partition the device, each filesystem is limited to the partition it is on. That takes a lot more thinking and planning than ZFS where you may have a boot partition and then "rest of device" partition, followed by datasets.

I'm not against UFS; I've used it and still do when it's the appropriate solution (I like it for external devices like USB devices for backup. Explicitly mount, use, explicitly umount). But for daily driver systems ZFS on a single device works fine.
If you don't have any partitioning requirements on a single drive system, you just let the installer automatically partition the drive for you. Zero thought. Now, setting up ZFS with the installer is pretty easy and doesn't require much thought either.

It's after installation and setup. If you don't maintain/think about your storage, you won't be taking advantage of what ZFS has to offer. Not like you will have any disadvantages with a "mindless" ZFS installation, but ZFS was designed for people who are very concerned with their storage and think about their storage on a regular basis.

I personally have ZFS on my home server. That's where my data lives. That's where I have VM's installed for various tasks. It's a good thing to be thinking about the storage on that device. On my desktop workstation, the only thing that I stand to lose is config files - everything else can quickly be re-installed with packages. I don't need or want to think about storage for that system, so I just use UFS and call it a day.
 
If you don't maintain/think about your storage, you won't be taking advantage of what ZFS has to offer
Yes and no.

You may not be getting as much out of it as you could, but you will get compression enabled out of the box, as well as boot environments created automatically when updating via freebsd-update(8) — although that can then cause confusion if you don’t realize this happens and are short on space.

So even without “thinking about it” I would suggest most are better off with ZFS, with the potential exception of installations with very restricted memory or storage capacities.

[edit: typo]
 
I've been reading some of Absolute FreeBSD (3rd Edition) by Michael Lucas.
In Chapter 2 he includes an overview of zfs and ufs filesystems.
Respect for copyright prevents any reproduction of large amounts of text right here.
But I do especially like these short extracts :
"If you’re running FreeBSD on modern hardware, though, you probably
want to use ZFS rather than UFS."
and
"All this advice is secondary to an iron rule: choose the filesystem that
best suits your environment."
Seems a good summary.
 
On the other hand, to contrast the advice given here, if you don't ever want to think about storage, UFS is the option for you. Lots of advantages to ZFS, but you have to maintain it in order to take advantage of it.
Like others, I'll disagree on that as well and put it the other way around: Nowadays, on some "reasonable" hardware, if you don't want to think about storage, ZFS is for you. There's no maintenance involved to profit from checksums and compression, and all the other features are easily accessible if you need them, and won't hurt if you don't and ignore them.

UFS is the option for you in several specific scenarios though, for example
  • most straight-forward, if the resources (especially RAM) needed by ZFS is an issue on some constrained system
  • also worth a thought for virtual machines using some virtual storage that already provides redundancy, snapshots, etc ... like e.g. bhyve with a virtual disk on ZFS ... then the extra resources needed to have ZFS inside this VM might not be worth what's to gain
  • some specific (rare on a "general purpose" machine) workload patterns exist that actually perform better on UFS than on ZFS. One example might be a machine serving lots of static data from its disk, an implementation using sendfile(2) will profit from a "zero-copy" optimized path available for UFS, but not ZFS.
  • ...?
 
switching from linux to bsd
i have used ext4 for years on linux, never crashed. and I hate zfs on my home bsd computer. snapshots send receive ect. complex garbage that is slow and sucks ram.

I use a boot disk with fsarchiver and a one line command to backup or restore the file system and another one line for the mbr.
It takes around 90 seconds for a backup
will do similar for freebsd.
zfs for my home use is pointless and painfull
 
I recently moved some datasets from a host to a jail using a few simple commands finishing in virtually no time, for introducing jailed NFS here. Random anecdote #4711 where ZFS was extremely useful. 🤷‍♂️

Well, we know this "complain about what you don't understand" scheme. It's not useful. It's ok not to use something for not understanding it, personal decision after all whether you invest the time (although in case of ZFS, most users will tell you the time will be very well invested). It's not ok to tell how something you don't understand just "sucks".

Bottom line stays the same as always. There are actual technical reasons NOT to use ZFS, they boil down to either just having too limited resources (mainly RAM) or having some very special usage scenario where e.g. UFS just performs better.
 
i have used ext4 for years on linux, never crashed.
Ext4 is a very good file system. It had teething problems during childhood, but that was decades ago. But it is still a single-disk file system, not integrated with the RAID layer, and mostly without checksum support.

and I hate zfs on my home bsd computer. snapshots send receive ect. complex garbage that is slow and sucks ram.
Calling it garbage is offensive. It is actually the best file system available for free at the consumer-grade.

Complexity comes with extra functionality, you can't have one without the other.

Slow is a two-edged sword. Yes, ZFS does more work behind the scenes: a lot of the slowness comes from calculating checksums, and there is real value in that. If you care about the data stored in the file system, using CPU power to calculate checksums is a great investment. ZFS is not inherently slow when compared fairly to other file systems; some of the world's fastest computers use ZFS (often under the covers of Ceph).

I use a boot disk with fsarchiver and a one line command to backup or restore the file system and another one line for the mbr.
It takes around 90 seconds for a backup
...
zfs for my home use is pointless and painfull
If you are willing to rely on your backups for durability and availability of your data, and "for your home use" want to treat the file system as disposable, then indeed ZFS is probably not a good choice for you. I would find that a very risky proposition. Have you actually tried and timed a full restore of your backups?
 
zfs for my home use is pointless and painfull
My opinion only:
First time you do a system upgrade that fails, the sheer joy of being able to roll back to a working Boot Environment make you realize "pointless is in the eye of the beholder".

I've been using ZFS on my home systems (single device and mostly mirrored configurations) for a long time, the basics have not been painful, yes some learning in the beginning, but you get that with every single filesystem ever used.
Are there use cases where it's not the right choice? Sure, but again that is true for every filesystem ever used.
 
Ext4 is a very good file system. It had teething problems during childhood, but that was decades ago. But it is still a single-disk file system, not integrated with the RAID layer, and mostly without checksum support.


Calling it garbage is offensive. It is actually the best file system available for free at the consumer-grade.

Complexity comes with extra functionality, you can't have one without the other.

Slow is a two-edged sword. Yes, ZFS does more work behind the scenes: a lot of the slowness comes from calculating checksums, and there is real value in that. If you care about the data stored in the file system, using CPU power to calculate checksums is a great investment. ZFS is not inherently slow when compared fairly to other file systems; some of the world's fastest computers use ZFS (often under the covers of Ceph).


If you are willing to rely on your backups for durability and availability of your data, and "for your home use" want to treat the file system as disposable, then indeed ZFS is probably not a good choice for you. I would find that a very risky proposition. Have you actually tried and timed a full restore of your backups?
Many times in linux I come off a cd and backup, ufs suits me better because clonezilla will do it. and yes speed matters also as does ram so ufs. sorry I called zfs garbage. but it is contrary to my needs on my home system
 
One thing to consider is when do you need a backup. I need it when the hardware breaks, or gives signs it is breaking. ZFS told me about disks going bad even before SMART picked it up. Had I done a backup then and restored it later, I would have ended up with damaged files without knowing. You mostly know what you need when you need it. Not before.
 
ZFS told me about disks going bad even before SMART picked it up. Had I done a backup then and restored it later, I would have ended up with damaged files without knowing.
To clarify, I think you’re pointing out that ZFS (thanks to checksums) will let you know that there are problems with the files before backing up, avoiding propagating silent corruption to your backups.
 
Back
Top