On Kubuntu or Neon, using ZFS as the root file system is not currently possible, unlike Btrfs, which can be chosen instead of EXT4 during the install process. A few other distros, which don't use systemd, have the ability to make zfs the root file system during the install. The reason stated by some is that systemd doesn't yet have a unit for ZFS which would allow zfs to be used as a root file system.
There are two versions of zfs in the Ubuntu Universe repository: zfs-fuse and OpenZFS. The Linux world is moving to OpenZFS. Be aware that OpenZFS is under the CDDL license which is incompatible with the GPL.
Its terms are:
https://www2.revolvy.com/topic/CDDL%...tem_type=topic
Of couse, Sun is no longer around and Oracle owns ZFS. It's a guess as to whether OpenZFS is safe to use or not. IF I use OpenZFS would Elison send a legal eagle after me for a few license dollars? Probably not, but if I owned a substantial business and considering how many jet fighers and Pacific Islands Ellison has to support, probably so. In doing a DDG search for companies that used OpenZFS on Linux or BSD I didn't find any that would admitted to it. There are some OS's that have ZFS baked in and are sold to commerically expoit zfs, but I don't know how many customers they have.
Do you have ZFS installed?
To see if the knernel version of zfs is already installed on your system use "modinfo zfs" and see if you get a giant listing of the "parm"s of the zfs kernel object. It is in the modinfo listing of zfs.ko that one finds the CDDL license listed. Apparently Linus approves.
To install OpenZFS, assuming the Universe repository is active:
sudo apt install zfs-initramfs
There are two basic commands related to ZFS: zpool and zfs. Their man pages describe all available commands. IF you want to use a GUI then Syneto offers an Industrial grade GUI, probably at an industrial price. The zpool command is related to the formation and manipulation of ZFS pools (also called "tanks", as in a tank of water), and the second relates to the formation of datasets (file systems) and their manipulation. At first I was under the impression that I could install other file systems inside ZFS, but that impression was wrong. EDIT: Perhaps not. Another ZFS guru claims one can install other file systems in a ZFS dataset (which they also refer to as a filesystem).
The first thing I did was to plug in my USB 320Gb Passport HD and run KPartition on it to delete the existing Btrfs partition and create an empty partition table on it. Then I did the following commands in a root Konsole:
Then I used Dolphin to drag and drop about 10Gb of data from my home account into homebk. When it was done I snapshotted homebk.
To "unmount" the zdata pool use
~# zpool export zdata
Then you can unplug the USB cable. When next you need to use it you can plug its USB cable in and issue
~# zpool import zdata
So, export and import act as mount and umount for external devices. Be aware that it is also possble to use mount and umount on datasets, but I haven't tried that yet.
BTRFS v ZFS
GPL vs CDDL
The license may determine the survivor despite any technical superiorities either tool may possess. If that is true, the Btrfs will continue to expand its Linux user base and soon dominate.
ROOT FILE SYSTEM
Btrfs wins hands down. On OpenSUSE, Ubuntu & its deriviatives and several other distros Btrfs is offered as a file system to use during the installation procedure.
Only a couple minor distros offers ZFS as a fs option during their installation process. For the remainder the proceedure to make ZFS the automatically booting root file system for a GUI DE is too arduous for most Linux users. Even a headless server needs an EXT or MSDOS 32 bit partition that contains /boot and grub.
If the license problem doesn't kill ZFS on the Linux desktop the difficulty facing most users for setting it up to boot into their desktop will.
SNAPSHOTS
The ZFS snapshot command is simpler than the Btrfs snapshot command, but not by much. With regards to snapshots it is my impression that ZFS is two dimensional. In ZFS both the pool and the datasets are visible at the same level. To see @ and @home on Btrfs one has to open a root Konsole and mount the main drive, usually sda1, to /mnt.
With Btrfs snapshots can be made at the root (/) as root, or at /home as root or user, or at the @ & @home level as root. Tools like snapper create hidden subvolumes and directories to hide snapshots in. ZFS creates a hidden ".zfs" directory that contains the snapshot. Snapshots on both Btrfs and ZFS can be navigated, or drilled down, to the individual file level and individual files copied back out to the original locations.
One caveat with ZFS and snapshots is that if one has created more than one snapshot and you want to rollback to the oldest, you have to delete those made after it before you can use the oldest one. What if your pool was corrupted and the snapshot deletion failed? EDIT: That info was wrong. Aother guru pointed out that one can rollback to any snapshot but in doing so all subsequent snapshots are destroyed. That makes sense because snapshots are stored in the same pool that was snapshotted. Older snapshots won't contain more recent snapshots.
SEND and RECEIVE
Btrfs usually uses both SEND and RECEIVE in the same command sequence because it involves streaming the snapshot between two different Btrfs pools. One can only create snapshots within the pool the subvolume exist on. SEND & RECEIVE allow transmitting subvolumes across pool boundries. Btrfs includes the ability to convert the snapshot stream into an ASCII stream which can be remotely stored on a non-Btrfs file system.
I haven't tried the ZFS SEND & RECEIVE commands yet, but the examples I'v read indicate that they don't always have to be run within the same command. Don't quote me on that, though.
RAID
Setting up RAID pools is drop dead easy in ZFS.
CONCLUSION
After playing with ZFS for a day I've come to the conclusion that despite some simpler command sequences it offers no advantage over Btrfs and has several disadvantages in the single user laptop environment for which I would use it.
I found a very interesting resource that explain ZFS and its commands:
https://pthree.org/2012/12/04/zfs-ad...n-part-i-vdevs
And a couple videos:
There are two versions of zfs in the Ubuntu Universe repository: zfs-fuse and OpenZFS. The Linux world is moving to OpenZFS. Be aware that OpenZFS is under the CDDL license which is incompatible with the GPL.
Its terms are:
https://www2.revolvy.com/topic/CDDL%...tem_type=topic
Terms
Derived from the Mozilla Public License 1.1,[5] the CDDL tries to address some of the problems of the MPL.[6] Like the MPL, the CDDL is a weak copyleft license in-between GPL license and BSD/MIT permissive licenses, requiring only source code files under CDDL to remain under CDDL. Unlike strong copyleft licenses like the GPL, mixing of CDDL licensed source code files with source code files under other licenses is permitted without relicensing. The resulting compiled software product ("binary") can be licensed and sold under a different license, as long as the source code is still available under CDDL, which should enable more commercial business cases, according to Sun.[6] [7] [8] Like the MPL the CDDL includes a patent grant to the licensee from all contributors ("patent peace").
Derived from the Mozilla Public License 1.1,[5] the CDDL tries to address some of the problems of the MPL.[6] Like the MPL, the CDDL is a weak copyleft license in-between GPL license and BSD/MIT permissive licenses, requiring only source code files under CDDL to remain under CDDL. Unlike strong copyleft licenses like the GPL, mixing of CDDL licensed source code files with source code files under other licenses is permitted without relicensing. The resulting compiled software product ("binary") can be licensed and sold under a different license, as long as the source code is still available under CDDL, which should enable more commercial business cases, according to Sun.[6] [7] [8] Like the MPL the CDDL includes a patent grant to the licensee from all contributors ("patent peace").
Do you have ZFS installed?
To see if the knernel version of zfs is already installed on your system use "modinfo zfs" and see if you get a giant listing of the "parm"s of the zfs kernel object. It is in the modinfo listing of zfs.ko that one finds the CDDL license listed. Apparently Linus approves.
To install OpenZFS, assuming the Universe repository is active:
sudo apt install zfs-initramfs
There are two basic commands related to ZFS: zpool and zfs. Their man pages describe all available commands. IF you want to use a GUI then Syneto offers an Industrial grade GUI, probably at an industrial price. The zpool command is related to the formation and manipulation of ZFS pools (also called "tanks", as in a tank of water), and the second relates to the formation of datasets (file systems) and their manipulation. At first I was under the impression that I could install other file systems inside ZFS, but that impression was wrong. EDIT: Perhaps not. Another ZFS guru claims one can install other file systems in a ZFS dataset (which they also refer to as a filesystem).
The first thing I did was to plug in my USB 320Gb Passport HD and run KPartition on it to delete the existing Btrfs partition and create an empty partition table on it. Then I did the following commands in a root Konsole:
Code:
~# zpool create zdata /dev/sdd ~# zfs create zdata/btrfsbk ~# zfs create zdata/homebk ~# zpool status pool: zdata state: ONLINE config: NAME STATE READ WRITE CKSUM zdata ONLINE 0 0 0 sdd ONLINE 0 0 0 errors: No known data errors ~# chown -R jerry:jerry /zdata/homebk
Code:
~# zpool scrub /zdata ~# zpool status pool: zdata state: ONLINE scan: scrub repaired 0 in 0h5m with 0 errors on Sat Nov 4 12:24:50 2017 config: NAME STATE READ WRITE CKSUM zdata ONLINE 0 0 0 sdd ONLINE 0 0 0 errors: No known data errors ~# zpool list NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT zdata 296G 10.5G 285G - 1% 3% 1.00x ONLINE - ~# zpool iostat zdata capacity operations bandwidth pool alloc free read write read write ---------- ----- ----- ----- ----- ----- ----- zdata 10.5G 285G 1 1 16.6K 14.1K ~# zfs snapshot -r zdata/homebk@201711041233 ~# zpool history History for 'zdata': 2017-11-03.13:24:02 zpool create zdata /dev/sdd 2017-11-03.21:38:04 zpool import zdata 2017-11-03.21:48:23 zfs create zdata/btrfsbk 2017-11-03.21:48:43 zfs create zdata/homebk 2017-11-04.12:19:08 zpool scrub zdata 2017-11-04.12:33:31 zfs snapshot -r zdata/homebk@201711041233
~# zpool export zdata
Then you can unplug the USB cable. When next you need to use it you can plug its USB cable in and issue
~# zpool import zdata
So, export and import act as mount and umount for external devices. Be aware that it is also possble to use mount and umount on datasets, but I haven't tried that yet.
BTRFS v ZFS
GPL vs CDDL
The license may determine the survivor despite any technical superiorities either tool may possess. If that is true, the Btrfs will continue to expand its Linux user base and soon dominate.
ROOT FILE SYSTEM
Btrfs wins hands down. On OpenSUSE, Ubuntu & its deriviatives and several other distros Btrfs is offered as a file system to use during the installation procedure.
Only a couple minor distros offers ZFS as a fs option during their installation process. For the remainder the proceedure to make ZFS the automatically booting root file system for a GUI DE is too arduous for most Linux users. Even a headless server needs an EXT or MSDOS 32 bit partition that contains /boot and grub.
If the license problem doesn't kill ZFS on the Linux desktop the difficulty facing most users for setting it up to boot into their desktop will.
SNAPSHOTS
The ZFS snapshot command is simpler than the Btrfs snapshot command, but not by much. With regards to snapshots it is my impression that ZFS is two dimensional. In ZFS both the pool and the datasets are visible at the same level. To see @ and @home on Btrfs one has to open a root Konsole and mount the main drive, usually sda1, to /mnt.
With Btrfs snapshots can be made at the root (/) as root, or at /home as root or user, or at the @ & @home level as root. Tools like snapper create hidden subvolumes and directories to hide snapshots in. ZFS creates a hidden ".zfs" directory that contains the snapshot. Snapshots on both Btrfs and ZFS can be navigated, or drilled down, to the individual file level and individual files copied back out to the original locations.
One caveat with ZFS and snapshots is that if one has created more than one snapshot and you want to rollback to the oldest, you have to delete those made after it before you can use the oldest one. What if your pool was corrupted and the snapshot deletion failed? EDIT: That info was wrong. Aother guru pointed out that one can rollback to any snapshot but in doing so all subsequent snapshots are destroyed. That makes sense because snapshots are stored in the same pool that was snapshotted. Older snapshots won't contain more recent snapshots.
SEND and RECEIVE
Btrfs usually uses both SEND and RECEIVE in the same command sequence because it involves streaming the snapshot between two different Btrfs pools. One can only create snapshots within the pool the subvolume exist on. SEND & RECEIVE allow transmitting subvolumes across pool boundries. Btrfs includes the ability to convert the snapshot stream into an ASCII stream which can be remotely stored on a non-Btrfs file system.
I haven't tried the ZFS SEND & RECEIVE commands yet, but the examples I'v read indicate that they don't always have to be run within the same command. Don't quote me on that, though.
RAID
Setting up RAID pools is drop dead easy in ZFS.
CONCLUSION
After playing with ZFS for a day I've come to the conclusion that despite some simpler command sequences it offers no advantage over Btrfs and has several disadvantages in the single user laptop environment for which I would use it.
I found a very interesting resource that explain ZFS and its commands:
https://pthree.org/2012/12/04/zfs-ad...n-part-i-vdevs
And a couple videos:
Comment