Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-8457

Want ZFS rootfs support

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Hide
      Attempt to a / on ZFS install while adapting instructions from Gentoo. Here are my notes:

      zpool create -f -o ashift=12 -o cachefile=/tmp/zpool.cache -O normalization=formD -O compression=lz4 -O xattr=sa -m none -R /mnt/funtoo -t tpool rpool /dev/sdd

      zfs create -o mountpoint=none tpool/ROOT
      zfs create -o mountpoint=/ tpool/ROOT/funtoo

      # Create home directories
      zfs create -o mountpoint=/home tpool/HOME
      zfs create -o mountpoint=/root tpool/HOME/root

      # Create portage directories
      zfs create -o mountpoint=none -o setuid=off tpool/FUNTOO
      zfs create -o mountpoint=/usr/portage -o atime=off tpool/FUNTOO/portage
      zfs create -o mountpoint=/usr/portage/distfiles tpool/FUNTOO/distfiles

      # Create portage build directory
      zfs create -o mountpoint=/var/tmp/portage -o sync=disabled tpool/FUNTOO/build-dir

      # Create optional packages directory
      zfs create -o mountpoint=/usr/portage/packages tpool/FUNTOO/packages

      # Create optional ccache directory
      zfs create -o mountpoint=/var/tmp/ccache tpool/FUNTOO/ccache

      cd /mnt/funtoo

      wget https://build.funtoo.org/1.4-release-std/x86-64bit/intel64-haswell/2021-05-05/stage3-intel64-haswell-1.4-release-std-2021-05-05.tar.xz{,.gpg}

      gpg --keyserver pgp.mit.edu --recv-key 11FD00FD 683A2F8A BEA87CD2 EEE54A43 62DD6D47 6B365A89

      gpg --verify stage3-intel64-haswell-1.4-release-std-2021-05-05.tar.xz{.gpg,}

      tar -C /mnt/funtoo --numeric-owner --xattrs --xattrs-include='*' -xpf stage3-intel64-haswell-1.4-release-std-2021-05-05.tar.xz


      mkdir -p /mnt/funtoo/etc/zfs
      cp /tmp/zpool.cache /mnt/funtoo/etc/zfs/zpool.cache


      cp /etc/resolv.conf /mnt/funtoo/etc/resolv.conf

      mount -t proc none /mnt/funtoo/proc
      mount --rbind /dev /mnt/funtoo/dev
      mount --rbind /sys /mnt/funtoo/sys

      chroot /mnt/funtoo /bin/bash
      env-update; source /etc/profile; export PS1="(chroot) $PS1"; cd

      ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime

      mkdir -p /etc/portage/package.use /etc/portage/profile/package.use.mask
      echo "sys-boot/grub:2 -libzfs" >> /etc/portage/profile/package.use.mask/zfs
      echo "sys-boot/grub:2 libzfs" >> /etc/portage/package.use/zfs

      emerge sys-fs/zfs sys-apps/gptfdisk sys-boot/grub:2 intel-microcode iucode_tool

      rc-update add zfs-import boot
      rc-update add zfs-mount boot
      rc-update add zfs-share default
      rc-update add zfs-zed default

      sgdisk --new=2:48:2047 --typecode=2:EF02 --change-name=2:"BIOS boot partition" /dev/sdd

      echo 1 > /proc/sys/vm/drop_caches

      grub-install --target=i386-pc --no-floppy /dev/sdd

      # Edit /usr/share/genkernel/gen_initramfs.sh to remove modprobe line

      genkernel initramfs --no-clean --no-mountboot --zfs

      I stopped taking notes (and did not tidy them up) after I started to encounter breakage, starting with genkernel. :/
      Show
      Attempt to a / on ZFS install while adapting instructions from Gentoo. Here are my notes: zpool create -f -o ashift=12 -o cachefile=/tmp/zpool.cache -O normalization=formD -O compression=lz4 -O xattr=sa -m none -R /mnt/funtoo -t tpool rpool /dev/sdd zfs create -o mountpoint=none tpool/ROOT zfs create -o mountpoint=/ tpool/ROOT/funtoo # Create home directories zfs create -o mountpoint=/home tpool/HOME zfs create -o mountpoint=/root tpool/HOME/root # Create portage directories zfs create -o mountpoint=none -o setuid=off tpool/FUNTOO zfs create -o mountpoint=/usr/portage -o atime=off tpool/FUNTOO/portage zfs create -o mountpoint=/usr/portage/distfiles tpool/FUNTOO/distfiles # Create portage build directory zfs create -o mountpoint=/var/tmp/portage -o sync=disabled tpool/FUNTOO/build-dir # Create optional packages directory zfs create -o mountpoint=/usr/portage/packages tpool/FUNTOO/packages # Create optional ccache directory zfs create -o mountpoint=/var/tmp/ccache tpool/FUNTOO/ccache cd /mnt/funtoo wget https://build.funtoo.org/1.4-release-std/x86-64bit/intel64-haswell/2021-05-05/stage3-intel64-haswell-1.4-release-std-2021-05-05.tar.xz {,.gpg} gpg --keyserver pgp.mit.edu --recv-key 11FD00FD 683A2F8A BEA87CD2 EEE54A43 62DD6D47 6B365A89 gpg --verify stage3-intel64-haswell-1.4-release-std-2021-05-05.tar.xz{.gpg,} tar -C /mnt/funtoo --numeric-owner --xattrs --xattrs-include='*' -xpf stage3-intel64-haswell-1.4-release-std-2021-05-05.tar.xz mkdir -p /mnt/funtoo/etc/zfs cp /tmp/zpool.cache /mnt/funtoo/etc/zfs/zpool.cache cp /etc/resolv.conf /mnt/funtoo/etc/resolv.conf mount -t proc none /mnt/funtoo/proc mount --rbind /dev /mnt/funtoo/dev mount --rbind /sys /mnt/funtoo/sys chroot /mnt/funtoo /bin/bash env-update; source /etc/profile; export PS1="(chroot) $PS1"; cd ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime mkdir -p /etc/portage/package.use /etc/portage/profile/package.use.mask echo "sys-boot/grub:2 -libzfs" >> /etc/portage/profile/package.use.mask/zfs echo "sys-boot/grub:2 libzfs" >> /etc/portage/package.use/zfs emerge sys-fs/zfs sys-apps/gptfdisk sys-boot/grub:2 intel-microcode iucode_tool rc-update add zfs-import boot rc-update add zfs-mount boot rc-update add zfs-share default rc-update add zfs-zed default sgdisk --new=2:48:2047 --typecode=2:EF02 --change-name=2:"BIOS boot partition" /dev/sdd echo 1 > /proc/sys/vm/drop_caches grub-install --target=i386-pc --no-floppy /dev/sdd # Edit /usr/share/genkernel/gen_initramfs.sh to remove modprobe line genkernel initramfs --no-clean --no-mountboot --zfs I stopped taking notes (and did not tidy them up) after I started to encounter breakage, starting with genkernel. :/
    • No one has worked on it yet.
    • Hide
      `ego boot update`, `grub-mkconfig` and genkernel do not work properly. `ego boot update` will fail because there is no / in /etc/fstab. It is possible to configure ZFS with one, but that is a legacy behavior (supported indefinitely by ZFS). `grub-mkconfig` will not generate the `root=ZFS=$dataset` kernel commandline option for genkernel. It also will attempt to specify a disk. This will fail to boot. genkernel calls `modprobe zfs`, which breaks installations from live media that use different kernels. As the person who wrote that, I can say that the line had been intended to place the ZFS modules with their dependencies into the initramfs, but in the current Funtoo genkernel, it neither does what it was intended to do nor is necessary.
      Show
      `ego boot update`, `grub-mkconfig` and genkernel do not work properly. `ego boot update` will fail because there is no / in /etc/fstab. It is possible to configure ZFS with one, but that is a legacy behavior (supported indefinitely by ZFS). `grub-mkconfig` will not generate the `root=ZFS=$dataset` kernel commandline option for genkernel. It also will attempt to specify a disk. This will fail to boot. genkernel calls `modprobe zfs`, which breaks installations from live media that use different kernels. As the person who wrote that, I can say that the line had been intended to place the ZFS modules with their dependencies into the initramfs, but in the current Funtoo genkernel, it neither does what it was intended to do nor is necessary.

      ZFS is a next generation filesystem that is known for strong data integrity and high performance. It supports integrated volume management, compression, encryption, RAID, tiered storage, and other advanced features. I use it almost exclusively for block device based storage and would like to see Funtoo support it. At present, I need to modify genkernel in the local filesystem before it will build an initramfs for it in a live environment. I also need to write the grub.cfg file by hand to boot using it.

            ryao ryao
            ryao ryao
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: