Compression and file integrity

Status
Not open for further replies.

rangopango

Contributor
Joined
Feb 21, 2018
Messages
151
Is it true there is a chance to damage the file if you transfer it to a dataset with enabled compression?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

rangopango

Contributor
Joined
Feb 21, 2018
Messages
151
When you compress a file, such as a song, there is a chance for loss of information. Doesn't the same thing apply for file system compression
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
When you compress a file, such as a song, there is a chance for loss of information. Doesn't the same thing apply for file system compression
If the file is able to be compressed, it will be, if not, then it isn't. ZFS is all about giving you back exactly the data you stored. The music and video editing software use an algorithm that throws data away to make a smaller file. That is not how actual compression works.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
When you compress a file, such as a song, there is a chance for loss of information.
Um, no. When you compress a song or a video, you're typically using a lossy codec. There isn't a "chance" of losing information, there's a guarantee that you will lose information--it's designed that way. But when you .zip a file, for example (or, really, do any other kind of compression), you're using a lossless technique. There isn't nearly as much space saving available, but the output is identical to the input.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Yep. Perfect example is using h264 (or other) to compress a 30 GB Bluray. You can get it down to <2 GB and it's still watchable. That compression algorithm is lossy and designed to take away detail that "won't be noticed if it's gone or smoothed out" as a trade-off for file size (bit rate).

Contrast that with LZ4: https://github.com/lz4/lz4

LZ4 is lossless and specifically trades off compression level (vs say gzip) for speed.
 
Status
Not open for further replies.
Top