Re: What is difference between zfs and ufs?

"Edward Sanford Sutton, III" <[email protected]>
Newsgroups gmane.os.freebsd.questions
Message-ID <BL4PR11MB8822D56ED2D3F63DC2FFAA66E6A72@BL4PR11MB8822.namprd11.prod.outlook.com>
On 8/17/26 12:14, Wojciech Puchar wrote:
>> UFS is just a regular file system, ZFS provides snapshots, logical 
>> volumes (datasets), RAID, encryption etc.
> UFS is bullet proof with near 40 year history.
> The only case that you may lose lot of data is that your disk fail 
> completely and is not mirrored or in other RAID protection.

   Or viruses/malware, or malicious/mistakes form a user, or a disk 
failing but not fully, or a bug in the OS+its filesystem that leads to 1 
bad disk write hitting any important data structure on disk.
   You may be surprised to learn about it, but a disk can have a bad 
sector happen in the partition table. The old MBR layout didn't have 
protection against it (though back in my DOS days I had already learned 
of a tool from my dad that kept a backup copy of the MBR elsewhere on 
disk. GPT now keeps a backup copy on disk. The hardware itself does not 
have that sector on an extra-reliable part of the media, increase its 
error recovery, or keep extra copies. If you are so certain that it can 
never become corrupted (which contradicts how the hardware works), have 
you considered contacting the engineers who designed the GPT standard 
and explaining to them how it can never be corrupted unless the disk 
completely fails and therefore space+I/O should not be wasted on such a 
backup?
   How long of a history is not what makes UFS so reliable, the tireless 
work of software engineers trying to do it right and then trying to 
create ways to fix things that could still happen anyway got it there. 
If it is so bulletproof, why does it ever still receive any code changes 
that are fixing bugs still?
   ZFS saw the value in RAID and integrated it to be a part of the 
filesystem. When you have a disk go offline for a moment and then come 
back, ZFS knows exactly which blocks need to be synced whereas other 
RAID arrays that don't have feedback from the filesystem keeping its own 
checksums and transaction history will have to resync the disk as a 
whole before it is ready to be trusted again. When silent corruption 
happens (rare enough some disks won't experience it, but data across a 
model of disk in all devices it'll happen somewhere sometime), 
conventional mirrored layouts won't know there is a failure unless the 
disk successfully reports that it cannot properly read the sector and 
parity based RAID only knows beyond that if it is actively causing 
excessive I/O + calculation + its latency (much worse processing power 
available on many controllers compared to the main CPU+RAM, but nice to 
be able to offload it otherwise) which is why parity is usually used to 
rebuild the array on disk failure/offline/replacement instead of for 
every read, and again recovery of all those cases normally requires 
sweeping the full disk to sync it in the array including all sectors 
that don't contain filesystem data but now you have to fully read from 
all disks in the array to rebuild data on the one disk and must write to 
the disk in full from start to finish unless the write is preceeded with 
an extra read step to calculate if a write is needed or not (normally 
not an option that I've seen).
   Then if your array uses SSDs and SMR drives you have the performance 
and wear penalties of a full disk write which is even worse than writing 
only sectors containing data and many times worse when it was just a 
drive temporarily dropping out and coming back. Though on the up side, 
SMR do prefer the sequential write sequence compared to the 'random' 
sequence that occurs when you go only where the data is (causes write 
amplification to read+write adjacent data) but performance of both will 
suck whet the task is big since you exceeded the cache the drive uses 
for faster activity. Both types of drives need to TRIM after such a 
blind+full write.
   UFS is a great filesystem, and I suggest people consider it when 
choosing what to use despite it not having all the shiny that ZFS provides.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.