nocow and compression
Hi,
I created a filesystem and mounted it with compress-force=lzo. Then I did:
# df -h . Filesystem Size Used Avail Use% Mounted on /dev/loop0 100M 4.1M 96M 5% /mnt
# yes "Hello World" | dd of=/mnt/test iflag=fullblock bs=1M count=20 status=none yes: standard output: Broken pipe yes: write error
# sync; ls -l ; df -h .
total 20480
-rw-r--r-- 1 root root 20971520 Oct 27 13:48 test
Filesystem Size Used Avail Use% Mounted on /dev/loop0 100M 4.7M 96M 5% /mnt
so far so good ...
# touch test2; chattr +C test2 # dd if=test of=test2 conv=notrunc bs=1M iflag=fullblock oflag=append status=none # sync; ls -l ; df -h . total 40960 -rw-r--r-- 1 root root 20971520 Oct 27 13:51 test -rw-r--r-- 1 root root 20971520 Oct 27 13:51 test2 Filesystem Size Used Avail Use% Mounted on /dev/loop0 100M 25M 76M 25% /mnt
oops, no compression.
Is this intended?
Marc
Quoted 2 lines · Le lundi 27 octobre 2014, 13:56:07 Marc Dietrich a écrit :
oops, no compression.
Is this intended?
« Compression does not work for NOCOW files » is clearly stated in
Kind regards.
Signature · 5 lines
Swâmi Petaramesh <[email protected]> http://petaramesh.org PGP 9076E32E Quand les doutes sont balayés, la foi véritable réapparaît, confirmée et redressée. Plus rien ne demeure, rien qu'il faille se remémorer. -- Seng-Ts'an, Troisième Patriarche, Le Sin-sin-ming (VIIe s)
Am Montag, 27. Oktober 2014, 13:59:24 schrieb Swâmi Petaramesh:
Quoted 8 lines · Le lundi 27 octobre 2014, 13:56:07 Marc Dietrich a écrit :
Quoted 2 lines
oops, no compression.
Is this intended?« Compression does not work for NOCOW files » is clearly stated in
https://btrfs.wiki.kernel.org/index.php/Compression#How_does_compression_int
eract_with_direct_IO_or_COW.3F
ah, sorry, I somehow overlooked this.
Thanks
Marc
As far as I understood, "NOCOW" means that modified parts of files be rewritten into place, whereas compression causes compressed blocks of variable sizes to be created (depending upon their compression ratio). Changing a block in a file will most probably change its compressed size, and then you see why it cannot be rewritten into place...
Somebody correct me if I'm wrong ;-)
Quoted 11 lines · Le lundi 27 octobre 2014, 14:06:36 Marc Dietrich a écrit :
Quoted 5 lines
« Compression does not work for NOCOW files » is clearly stated in
https://btrfs.wiki.kernel.org/index.php/Compression#How_does_compression_i
nt eract_with_direct_IO_or_COW.3Fah, sorry, I somehow overlooked this.
Thanks
Marc
Signature · 4 lines
Swâmi Petaramesh <[email protected]> http://petaramesh.org PGP 9076E32E Tout être manifesté est là pour embaumer, pour exprimer la Présence. -- Jean-Marc Mantel