5

So in the new Ubuntu 20.04 (which I have) it is written on their blog page that

Ubuntu 20.04 LTS ships with a newer ZFS which features native, hardware-enabled encryption, device removal, pool trim and improved performance. While still experimental, we’ve built upon this feature with the addition of zsys.

I wanted to understand this 'support' and what actually they mean by that.

So upon doing df -T I got the following output (of which I am posting the first 2 relevant columns):

Filesystem     Type    
udev           devtmpfs   
tmpfs          tmpfs      
/dev/sdb2      ext4     
tmpfs          tmpfs      
tmpfs          tmpfs      
tmpfs          tmpfs      
/dev/loop0     squashfs   
/dev/loop4     squashfs   
/dev/loop3     squashfs   
/dev/loop2     squashfs   
/dev/loop5     squashfs   
/dev/loop7     squashfs   
/dev/loop11    squashfs    
/dev/loop9     squashfs    
/dev/loop10    squashfs    
/dev/loop1     squashfs    
/dev/loop12    squashfs    
/dev/loop8     squashfs     
/dev/loop13    squashfs     
/dev/loop14    squashfs     
/dev/loop18    squashfs     
/dev/loop17    squashfs     
/dev/loop16    squashfs     
/dev/loop15    squashfs     
/dev/loop6     squashfs     
/dev/loop19    squashfs    
/dev/sda2      vfat         
tmpfs          tmpfs       
tmpfs          tmpfs
/dev/sdb1      fuseblk

So I can see ext4 not zfs, then I got to know that we have zfs module but not loaded as lsmod | grep zfs gave nothing, so I did sudo modprobe zfs (now I could see it upon doing lsmod) but upon loading it, zfs command was still unrecognized and I found in this Getting Started With ZFS Ubuntu 20.04 article that I have to install it using apt.

Also on a side note if I try to find ext modules then lsmod | grep ext4 gives nothing.
So what purpose does the module serve? Why the whole thing is not already pre-installed? Am I missing something here?


So I have understood that why and where ZFS is configured when installed, but what I do not understand is, suppose you do not configure ZFS upon installation and now want to do it, then first you have to load some modules and then install zfsutils. Why is that? Why it is not build like we can just load the whole thing?

Also, currently I am not able to find the ext4 modules

9

Whenever Ubuntu is installed, the root partition / require some file system to be created. Ubuntu, prior to 19.10, had options such as extended file system, btrfs, JFS, XFS, etc. Of all the options available, extended file system, to be precise, ext4 is preferred for now*.
*There are some blogs that says Linux might gradually move to btrfs.

Eoan Ermine announced the support for ZFS for root file system. According to New Features - Eoan Ermine/ReleaseNotes:

ZFS on root

  • Support for ZFS as the root filesystem is added as an experimental feature in 19.10
  • Create the ZFS file system and partitioning layout automatically direct from the installer

Eoan Ermine had ZFS version 0.8.1. The option to use ZFS for root filesystem is only available from the installer, i.e., while installing Ubuntu. The usage is experimental and thus optional.

Focal Fossa (20.04) introduced the newer version of ZFS and this was the first LTS release to have ZFS support for root filesystem. From Storage/File Systems - Focal Fossa/ReleaseNotes:

ZFS 0.8.3

Continuing with what started in the Eoan release, Ubuntu Focal ships zfs 0.8.3. Compared to what was available in the previous LTS release, zfs 0.8 brings many new features. Highlights include:

  • Native Encryption (with hardware acceleration enabled in Focal)
  • Device removal
  • Pool TRIM
  • Sequential scrub and resilver (performance)

Although Ubuntu supports ZFS but Linus Torvalds discourages its usage because of licensing issues from Oracle.

It seems you've installed Ubuntu in /dev/sdb2 which is formatted in ext4 file system. sqashfs is the filesystem being used by snaps in small loop devices (See Small snap loop devices visible in gnome-disk-utility OR what is the function of snap ubuntu-core). As a result, you didn't find anything related to ZFS in your system.

Though Ubuntu started supporting ZFS for root partitions after the release of Eoan Ermine, ZFS was supported for other partitions since Xenial Xerus (16.04) (see Ubuntu 16.04 LTS (Xenial Xerus) - Ubuntu version history - Wikipedia). zfsutils-linux is a package which provides some management utilities for ZFS. If you run cat /proc/filesystems | grep zfs without installing the above said package, the output would be empty which means that some, if not all, operations for ZFS won't be available and may not work as expected.

Similarly, e2fsprogs provides management utilities for extended file systems. This include ext2, ext3 and ext4. This package mostly comes pre-installed since as of now ext4 is the widely used filesystem for Linux system. For information about pre-installed packages, see the corresponsing manifest file. For example, this is the manifest file for 20.04's server image.


Some related articles:

| improve this answer | |
  • Thanks for the reply, my question is partially cleared, I have added a edit for the remaining doubt. – Aaryan BHAGAT Jul 11 at 19:08
  • @AaryanBHAGAT I'm not sure what you mean by "modules". libext2fs2 provides libraries and e2fsprogs provides utilities. – Kulfy Jul 11 at 19:38
  • I am actually drawing analogies, I mean after loading the zfs modules using modprobe zfs I actually see them using lsmod, but no such thing I am able to find for ext4. Are they differently implemented? – Aaryan BHAGAT Jul 11 at 19:39
  • 1
    @AaryanBHAGAT Yes. ext filesystems are recognised by the kernel itself and it may not need additional modules. Same goes for squashfs. – Kulfy Jul 11 at 20:01
1

So I have understood that why and where ZFS is configured when installed, but what I do not understand is, suppose you do not configure ZFS upon installation and now want to do it, then first you have to load some modules and then install zfsutils. Why is that? Why it is not build like we can just load the whole thing?

The installer uninstall unused packages taking into account your current configuration. It does not leave installed most file system administration utilities by default because most people won't be editing partitions further but will readily recognize the file system types you use.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.