#!/usr/bin/env bash # All the zfs packages in debian stretch apt install -y dkms busybox-static apt install -y initramfs-tools dh-autoreconf apt install -y linux-headers-$(uname -r) zfs-dkms zfs-initramfs zfsutils-linux apt install -y zfs-zed echo "linux default, mount partitions even if non-empty, the no option really only makes sense if the directory being mounted on has been declared as a mount point only and is therefore guaranteed to be empty." sed -i "s,^\(DO_OVERLAY_MOUNTS=\).*,\1\'yes\'," /etc/default/zfs echo "replace the pool name detection with zdb command in /etc/grub.d/10_linux." sed -i "s|rpool=.*|rpool=\`zdb -l \${GRUB_DEVICE} \| grep -E '[[:blank:]]name' \| cut -d\\\' -f 2\`|" /etc/grub.d/10_linux echo "adding zfs scrub to cron.weekly" cat > /etc/cron.weekly/zfs-scrub-weekly <