Skip to content

Instantly share code, notes, and snippets.

@sq3
Last active May 16, 2018 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sq3/21fb892dc6bd28316bac5bc21f0abbc2 to your computer and use it in GitHub Desktop.
Save sq3/21fb892dc6bd28316bac5bc21f0abbc2 to your computer and use it in GitHub Desktop.
setup zfs on arch
#!/bin/bash
# this script isntalls zfs via dkms and needs sudo package installed an
# configured for the user who runs this script.
#
# The zpools are named tank.
# Give the disk you want to use for the zpool as $1
#
# https://wiki.archlinux.org/index.php/ZFS
$1=pool_disk
sudo pacman -Suy
sudo pacman -S linux-lts linux-lts-headers
sudo pacman -R linux
sudo pacman -S dkms
grub-mkconfig -o /boot/grub/grub.cfg
curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/spl-dkms.tar.gz
tar xvfz spl-dkms.tar.gz
cd spl-dkms
makepkg -sri .
cd ..
curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/zfs-dkms.tar.gz
ls -la
tar xvfz zfs-dkms.tar.gz
cd zfs-dkms
ls -la
cd zfs-dkms
ls -la
makepkg -sri .
sudo modprobe zfs
sudo zpool create tank $pool_disk
zpool set cachefile=/etc/zfs/zpool.cache tank
systemctl enable zfs-mount
systemctl enable zfs-import-cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment