Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: How is ZFS coming in Ubuntu's development of it?

  1. #11
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How is ZFS coming in Ubuntu's development of it?

    I think the OP wants ZFS as a boot device and pre-installed on all versions of Ubuntu, selected as the default file system so that choosing anything else takes extra work - A checkbox is all that LVM+ext4 needs and I vaguely remember ZFS being a 'beta' option in 20.04 for the OS.

    I can also confirm that lxd **really**, really, really, wants to force us into using ZFS. They have valid reasons, but I really hate being forced into something I'm not prepared to use. Sure, lxd has methods to use other storage types and file systems, but those are poorly documented and I wasn't able to get LVM working, so I ended up with
    container storage ---> ZFS ---> block file --> LV ---> VG --> PV --> LVM --> Partition --> HDD.
    Not exactly thin. I'd actually setup thin provisioned LV just for LXD's use, so it was pretty maddening to have to give up and use 2 extra layers that I didn't want.

    There are lots of things LXD forces onto a system. For example, LXD is only shipped as a snap package, so to use lxd and stay patched with lxd, snapd and snap packages have to be allowed. LXD containers are extremely useful and don't require learning an entire new way of dealing with OSes like Docker and other containers do. With LXD, we can treat the container just like a VM OS. Also, there are plenty of options for which OS to run in an lxd container. The Ubuntus for containers are not as bloated as some containers like CentOS (75MB vs 150MB), but they aren't as light as the most popular container base OS - alpine, which is less than 5MB.

    If you are comfortable with a shell and need a light server, say for an internal website or postfix/email server, then alpine has much to offer. Install and init lxd, then run:
    Code:
    $ time lxc launch images:alpine/3.14/cloud alpine-two
    Creating alpine-two
    Starting alpine-two                         
    
    real    0m8.481s
    user    0m0.061s
    sys     0m0.035s
    No sudo needed. Takes about 10 seconds to download and init, then launch.
    Code:
    $ lxc list
    +-------------+---------+----------------------+------+------------+-----------+
    |    NAME     |  STATE  |         IPV4         | IPV6 |    TYPE    | SNAPSHOTS |
    +-------------+---------+----------------------+------+------------+-----------+
    | alpine-two  | RUNNING | 172.22.22.237 (eth0) |      | PERSISTENT | 0         |
    +-------------+---------+----------------------+------+------------+-----------+
    Connect to the container ...
    Code:
    $ lxc exec alpine-two  -- ash
    Go crazy. It is the root account, so be careful. It "feels" like a Linux server should, just missing bash, which can be installed with the alpine package manager. Beware, any installed packages add to the bloat. After installation - from inside the VM, it is using 44MB for /. apk is the package management system on Alpine. https://wiki.alpinelinux.org/wiki/Al...age_management Best of all, they don't install nano! That warms the cockles of my heart. Use vi.
    Code:
    # apk add bash bash-completion
    And how much bloat?
    Code:
    # df -Th
    Filesystem           Type            Size      Used Available Use% Mounted on
    lxd/containers/alpine-two
                         zfs             9.6G     46.9M      9.5G   0% /
    Maybe Ubuntu 20.04 in a container isn't so bad? Here's the storage used from inside an email gateway running 20.04 Ubuntu lxd image:
    Code:
    $ df -Th
    Filesystem           Type      Size  Used Avail Use% Mounted on
    lxd/containers/spam1 zfs        11G  1.5G  9.6G  13% /
    Here's from inside a little wallabag web-app server (that a LAMP webapp like Read-It-Later) also on 20.04:
    $ df -Th
    Filesystem Type Size Used Avail Use% Mounted on
    lxd/containers/wallabag zfs 11G 976M 9.6G 10% /

    On a different system, here's a 20.04 server just for backups - the answers appear to be from the hostOS, not just the container. This system isn't using ZFS for container storage.
    Code:
    $ df -Th
    Filesystem     Type      Size  Used Avail Use% Mounted on
    /dev/sdc1      ext4       20G   13G  5.9G  68% /
    There's a way to have the container dump all sorts of current information to json or yaml so we can see the RAM, CPU, and disk used. ...
    Code:
    name: back-2004
        disk: {}
        memory:
          usage: 1222651904
          usage_peak: 5017935872
          swap_usage: 0
          swap_usage_peak: 0
        cpu:
          usage: 661756367660
    Appears it can't figure out the storage since I didn't use ZFS. Found it under /var/snap/lxd/common/lxd/storage-pools/lxd/containers
    # du -sh back-2004
    1.8G back-2004
    That just has ssh and rdiff-backup stuff. Crazy, right?
    Last edited by TheFu; October 12th, 2021 at 11:56 PM.

  2. #12
    Join Date
    Mar 2011
    Location
    19th Hole
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How is ZFS coming in Ubuntu's development of it?

    This Alpine option is AWESOME!

    I'm constantly learning cool stuff from you.

    Quote Originally Posted by TheFu View Post
    I think the OP wants ZFS as a boot device and pre-installed on all versions of Ubuntu, selected as the default file system so that choosing anything else takes extra work - A checkbox is all that LVM+ext4 needs and I vaguely remember ZFS being a 'beta' option in 20.04 for the OS.
    But, if memory serves, not on Focal. Granted, my memory is like a sieve these days, but I recall that it was now a regular selection at install (for the desktop anyways). That's why my HDD is set up entirely in ZFS on two laptops. That decision came with some unwanted fallout, but not relevant to the issue at hand.

    I can also confirm that lxd **really**, really, really, wants to force us into using ZFS.
    <snip>
    Not exactly thin.
    Anything but. Rather thick, I'd say. But for SOHO use, where fat, juicy installs aren't really a big deal, it's not an impediment. For uber-gurus running hundreds of container instances and wishing to eek the last smidgeon of efficiency out of each container, I understand the frustration.
    There are lots of things LXD forces onto a system. For example, LXD is only shipped as a snap package, so to use lxd and stay patched with lxd, snapd and snap packages have to be allowed.
    True enough. I've made my peace with snap—or at least called a truce with it. Even Firefox will henceforth be shipped only as a snap (Chromium has only been available that way for some time), so one has to come to terms with it and move on. But I do hear you.
    …Crazy, right?
    What is there about the black art of computing that isn't crazy?
    Stay safe, stay crazy.

    DH

  3. #13
    Join Date
    Oct 2014
    Location
    Santiago DR
    Beans
    164
    Distro
    Ubuntu

    Re: How is ZFS coming in Ubuntu's development of it?

    I use ZFS since 2017 and it is a great file management system, that is a perfect fit for desktops too. ZFS is very reliable! I have used it on a HP dc5850 (Phenom II X4 B97; 8GB DDR2) and since 2019 with a Ryzen 3 2200G and 16GB DDR4. I installed Ubuntu 21.04 on ZFS and that works flawlessly. I use it mostly for the standard work and my hobby is virtual machines and since 2010 I use Virtualbox. The performance of OpenZFs and Virtualbox is good, I boot Ubuntu VMs in ~10 seconds and Windows 11 VM in ~30 seconds from a nvme-SSD. By default all storage and all caches are lz4 compressed by OpenZFS in Ubuntu. My compression ratio is ~2.0, which means that the system only needs half the IO Operations to boot an OS or to load a program. With respect to memory usage, on my system I limit the L1ARC memory cache to 4GB.

    OpenZFS is a mature file system in contradiction to btrfs that is still finishing the more complex features. OpenZFS is also used on many other systems like FreeBSD; Proxmox; TrueNAS and more. I use a FreeBSD (Pentium 4 HT; 2GB DDR and 4 HDDs 2 IDE and 2 SATA) as my backup server. For incremental backups ZFS only sends the changed 128K records lz4 compressed! OpenZFS is superior for maintaining, snap-shotting and backing up your data.

    However I'm less happy with the Ubuntu add-on for operating system snapshots, I normally purge that function/package (zsys) directly. It is only used to create too many automatic snapshots with useless names. For 21.10 I had another look at it, but I had a problem with it on Xubuntu 21.10 trying to revert to and boot from a manual snapshot created with zsys. For all file systems (ext4; btrfs or openzfs) I would backup the home directory and the other user directories, so you can re-install the OS from scratch if needed.
    Last edited by lammert-nijhof; October 13th, 2021 at 05:00 AM.

  4. #14
    Join Date
    Mar 2011
    Location
    19th Hole
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How is ZFS coming in Ubuntu's development of it?

    Quote Originally Posted by DuckHook View Post
    …my HDD is set up entirely in ZFS on two laptops. That decision came with some unwanted fallout, but not relevant to the issue at hand.
    Quote Originally Posted by lammert-nijhof View Post
    However I'm less happy with the Ubuntu add-on for operating system snapshots, I normally purge that function/package (zsys) directly. It is only used to create too many automatic snapshots with useless names. For 21.10 I had another look at it, but I had a problem with it on Xubuntu 21.10 trying to revert to and boot from a manual snapshot created with zsys. For all file systems (ext4; btrfs or openzfs) I would backup the home directory and the other user directories, so you can re-install the OS from scratch if needed.
    This was the "unwanted fallout" I mentioned. Glad you posted in detail. It may be relevant to the OP after all.

    @OP

    You can now choose to have the Ubuntu desktop install process automatically format your HDD/SSD as ZFS at time of initial install. However, as lammert-nijhof points out, this will also set it up to take snapshots of your system on an automated basis. This will quickly exhaust your free disk space and, at least for me, led to frustratingly obscure breakages that it took some time to correct. I had to do much the same as lammert-nijhof did, and disabled this function, but through obscure settings rather than by purging the zsys package. In future, I may use lammert-nijhof's nuke option because it is much simpler and easier to implement.

  5. #15
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How is ZFS coming in Ubuntu's development of it?

    I have a single machine running Ubuntu desktop. I have no experience with ZFS and a little experimental experience of btrfs some years ago. With btrfs an additional option is put into the Friendly Recovery menu. It was called apt-snapshots ... Revert to old snapshot and reboot. Does using ZFS put such an option into the Friendly Recovery menu?

    Regards
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


  6. #16
    Join Date
    Oct 2014
    Location
    Santiago DR
    Beans
    164
    Distro
    Ubuntu

    Re: How is ZFS coming in Ubuntu's development of it?

    The function to revert to an old snapshot is present not in OpenZFS but in the Ubuntu add-on around zsys. Like I said, I found it did not work with manual created snapshots. I wrote a bug-report and a patch has already been issued, but not yet distributed. As far as I understood the cause was a mis-merge of source, that introduced an old version of initramfs. Today Ubuntu 21.10 will be released, I hope with that patch, since the bug has been classified as "critical".

    I have now two options using Ubuntu on OpenZFS.
    - Purge zsys and work without the revert and reboot from a snapshot or
    - switch off the automatic snapshots by:

    systemctl --user stop zsys-user-savestate.timer
    systemctl --user disable zsys-user-savestate.timer
    sudo mv /etc/apt/apt.conf.d/90_zsys_system_autosnapshot /etc/apt/apt.conf.d/90_zsys_system_autosnapshot_disabled

    and then I use the following command to create my manual snapshots (-s stands for the whole system directory structure including /home):

    zsysctl save <snapshot name> -s

    Note that OpenZFS itself is a rock solid professional file system. The problem is around the handling of manual system snapshots introduced by Ubuntu on top of OpenZFS. The whole situation has been complicated by the introduction of UEFI boot and its corresponding UEFI partition in the FAT format (Thanks Microsoft). That initramfs probably mishandles the FAT partition and always regenerates the last version of initrd, so you have a mismatch during the snapshot boot between the selected and last Linux versions.

    I will try it out that patch during one of the next days.
    Last edited by lammert-nijhof; October 14th, 2021 at 03:51 PM.

  7. #17
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How is ZFS coming in Ubuntu's development of it?

    Snapshots are great! Snapshots retained too long are a blight on a system.

    I can see a use to have 2 weeks of snapshots retained by almost everyone - it wouldn't be tied to any specific number, just the time on a calendar. Of course, it would depend on how full the disk is and how good the admin is at making backups to other storage.

    For lurkers ... I fear that normal people will confuse "snapshot" with "backup", a term that gets abused by so many backup tools. Backups and snapshots aren't the same things. Snapshots feed into backups and can make getting a good backup easier and cleaner, but until the bits of moved off the source storage to different storage, hopefully 500 miles away, it isn't really a "backup." Using terms in a technically accurate way is very important. Don't get me started about "full stack" developers that only know 1 language and very little about administration and security of systems.

  8. #18
    Join Date
    Oct 2014
    Location
    Santiago DR
    Beans
    164
    Distro
    Ubuntu

    Re: How is ZFS coming in Ubuntu's development of it?

    Quote Originally Posted by lammert-nijhof View Post
    The function to revert to an old snapshot is present not in OpenZFS but in the Ubuntu add-on around zsys. Like I said, I found it did not work with manual created snapshots. I wrote a bug-report and a patch has already been issued, but not yet distributed. As far as I understood the cause was a mis-merge of source, that introduced an old version of initramfs. Today Ubuntu 21.10 will be released, I hope with that patch, since the bug has been classified as "critical".

    I will try it out that patch during one of the next days.
    Today the maintainer asked me to test that patch after, it has been made available in the "proposed" libraries. The problem seems to be solved, no more problems during the boot! The revert/rollback to a snapshot via the grub boot menu works fine. You can use Ubuntu again very soon with the snapshots, as soon as they move the modified software from proposed to the official version of Ubuntu 21.10. I will test it somewhat more with the coming Ubuntu updates, now I did test it with some files in my home folder. I will keep working with it and I installed it also on my Host OS. Normally I move early say November to the development edition of 22.04 and I will keep trying it in a VM, because I will depend on it.

    I keep you informed of the progress.
    Last edited by lammert-nijhof; October 16th, 2021 at 02:44 AM.

  9. #19
    Join Date
    Oct 2014
    Location
    Santiago DR
    Beans
    164
    Distro
    Ubuntu

    Re: How is ZFS coming in Ubuntu's development of it?

    Personally I don't like automated snapshots, the names are often useless and soon they clutter up your system. I use scripts to make manual snapshots and so I have the freedom to use my own rules for snapshot names and I can decide myself, which ones I want to keep or destroy.

  10. #20
    Join Date
    Mar 2011
    Location
    19th Hole
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How is ZFS coming in Ubuntu's development of it?

    Quote Originally Posted by lammert-nijhof View Post
    Personally I don't like automated snapshots, the names are often useless and soon they clutter up your system. I use scripts to make manual snapshots and so I have the freedom to use my own rules for snapshot names and I can decide myself, which ones I want to keep or destroy.
    I'm glad that you are forging the path ahead for us (and I greatly appreciate it!). Your description of the problem is precisely why I disable this "feature": it was more painful than the "problem" it was meant to cure. One day I just found my HDD completely full. The traditional df showed lots of room. At that time, I did not know that df is not ZFS-aware and will return with incorrect readings. It took the better part of a day and ridiculous amounts of web-search-fu to understand the obscure processes going on behind the scenes. I had to use ZFS utilities to delete the accumulated shapshots, then disabled the service altogether. Like you, I want to control the whole snapshot process and not have the system blindly snapshot every time I do an update/upgrade.

    Moreover, since I upgrade on a regular basis, the snapshots add up quickly. The old zsys process did not delete older snapshots to make way for newer ones and was not smart enough to free up disk space for non‑snapshot storage needs. Perhaps it was early days and the worst bugs have been worked out, but it soured me on the whole concept.

    I will await the results of your experimentation with anticipation.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •