ZFS, what's not to love?

Status
Not open for further replies.

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Something came up where I wanted to test booting off 2 different root volumes in Linux using it's LVM & EXT4. I figured I'd simply copy my existing root FS, (which uses ZFS), and modify the "/etc/fstab" for "/" as appropriate.

Well, I saw my ZFS root was about 10GB. So I created my 2 root volumes in LVM as 10GB. Then copied to one LVM volume with Rsync. But, it did not stop when it was the same size, it keep growing!

root@laptop:/# df -h / /mnt/usb
Filesystem Size Used Avail Use% Mounted on
rpool/root/20180220 9.7G 3.7G 6.0G 39% /
/dev/mapper/rootdg-rootv1 9.8G 5.8G 3.6G 62% /mnt/usb


I then realized my root pool's top level dataset used LZ4 compression, and everything inherited that attribute. I had not realized that I had gotten that good of compression, (see below). In the back of my mind I know ZFS, (without compression), can take more space due to checksumming and metadata copies. But, net gain when using LZ4 compression? Great. Something else to love about ZFS.

root@laptop:/# zfs get all rpool/root/20180220 | grep comp
rpool/root/20180220 compressratio 1.77x -
rpool/root/20180220 compression lz4 inherited from rpool
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
You can also get a gain by selecting an appropriate recordsize for your dataset. Setting this on my media datasets, I can save a bit of space.
Code:
[root@tardis] ~# zfs get recordsize,used,logicalused tank/media/movies
NAME			   PROPERTY	 VALUE	SOURCE
tank/media/movies  recordsize   1M	   local
tank/media/movies  used		 666G	 -
tank/media/movies  logicalused  671G	 -
[root@tardis] ~#
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Status
Not open for further replies.
Top