Skip to content

Instantly share code, notes, and snippets.

@donnitriosa
Created March 10, 2024 09:23
Show Gist options
  • Save donnitriosa/da966f5d5db779b28419b347f01e9d54 to your computer and use it in GitHub Desktop.
Save donnitriosa/da966f5d5db779b28419b347f01e9d54 to your computer and use it in GitHub Desktop.
Script to Install ZFS on Debian
#!/bin/bash -e
# Script to intall zfs on debian
# use root to run this script
# Create By Donni Triosa ([email protected])
# check if user is root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit 1
fi
# update system
apt-get update
echo "$(uname -r)"
apt-get install -y linux-headers-$(uname -r) linux-image-amd64 dpkg-dev
sleep 5
# install zfs
echo "zfs" > /etc/modules-load.d/zfs.conf
apt-get -y install zfs-dkms zfsutils-linux
apt-get -y purge --autoremove
apt-get -y clean
# check if zfs is installed
if [ -d "/sys/module/zfs" ]
then
echo "ZFS has been installed"
else
echo "ZFS has not been installed"
fi
# reboot
echo "Rebooting in 5 seconds"
sleep 5
reboot
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment