- 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!
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.
	
		
			
		
		
	
			
			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/usbI 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