1. 20
  1. 3

    I’m always concerned about the potential foot guns of enabling features and losing my ability to boot.

    There is a cool project (that admittingly I haven’t tried yet) ZFS Boot Menu[1] that solves a lot of these problems for Linux users. Roughly how it works is put a Linux kernel and an initramfs with a ZFS kernel module on a small non ZFS file system (eg efi system partition). Eliminating the need for a traditional bootloader to support zfs.

    [1] https://zfsbootmenu.org/

    1. 5

      Eliminating the need for a traditional bootloader to support zfs.

      The easiest is to have a separate /boot partition in an universal-ish filesystem like ext2 or vfat.

      1. 4

        One of the most compelling features of ZFS on root in my opinion is boot environments. Any time something is about to change on my system a snapshot can be taken and a bootable clone created so in the event something breaks I can select the pre broken environment at the the bootloader.

        By putting /boot on a separate partition it creates the possibility of a split brain system where for example I’ve gotten a new kernel and some other important package has broken so I’ve booted into my old environment. In this scenario I’m booting (assuming the break wasn’t the kernel upgrade itself) but I’m on a newer kernel and my package manager believes that still on an older version.

        For a consistent environment, having /boot on zfs included is vital.

        1. 2

          When I upgrade my kernel I keep the old one around, sometimes more than one. So in that situation I’ll have it available if I booted an older root filesystem.

      2. 1

        I have tried this. I love it. The install process even caught my custom-added kernel cmdline from grub and brought it along.

        Disclaimer: I know the maintainers (on IRC).

        1. 1

          I like the ZFS Boot Menu project.

          Do you know any Linux distribution that use it? Like I mean you just install such Linux as Ubuntu or Debian and after reboot you end up with Linux system with ZFS Boot Environments and ZFS Boot Menu setup?

          Regards.

          1. 2

            I don’t know, but I think it sounds like a decent idea.

        2. 2

          Great article. Enabling features seems to be quite the pitfall.

          cat|lolcat seems like cat abuse to me.

          1. 2

            You are right.

            It could be just:

            % lolcat -b -r FILE
            

            Instead of typical useless use of cat(1) with:

            % cat FILE | lolcat -b -r
            
            1. 1

              In general cat FILE | ... can also be replaced by <FILE .... Of course if the command itself can take a file path as an argument that works too.