Last active
July 21, 2016 11:10
-
-
Save sq3/020ee5b8ab39af4f3b4b to your computer and use it in GitHub Desktop.
Arch system and ZFS upgrade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# colours | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
CWD=/tmp/zfs-$(date +%Y-%m-%d) | |
mkdir $CWD | |
cd $CWD | |
echo "${GREEN} >> stop file server${NC}" | |
sudo systemctl stop file-server-frontend.service | |
echo "${GREEN} >> export zpool${NC}" | |
sudo zpool export tank | |
echo "${GREEN} >> stop zed service${NC}" | |
sudo systemctl stop zed.service | |
echo "${GREEN} >> remove zfs kernel module${NC}" | |
sudo modprobe -r zfs | |
echo "${GREEN} >> remove zfs${NC}" | |
sudo pacman -Rs zfs-linux-lts zfs-utils-linux-lts spl-linux-lts spl-utils-linux-lts | |
echo "${GREEN} >> running system updates${NC}" | |
sudo pacman -Syu | |
echo "${GREEN} >> installing spl-utils-linux-lts...${NC}" | |
wget https://aur.archlinux.org/cgit/aur.git/snapshot/spl-utils-linux-lts.tar.gz | |
tar xvfz spl-utils-linux-lts.tar.gz | |
cd spl-utils-linux-lts | |
makepkg -sri | |
cd .. | |
echo "${GREEN} >> installing spl-linux-lts...${NC}" | |
wget https://aur.archlinux.org/cgit/aur.git/snapshot/spl-linux-lts.tar.gz | |
tar xvfz spl-linux-lts.tar.gz | |
cd spl-linux-lts | |
makepkg -sri | |
cd .. | |
echo "${GREEN} >> installing zfs-utils-linux-lts...${NC}" | |
wget https://aur.archlinux.org/cgit/aur.git/snapshot/zfs-utils-linux-lts.tar.gz | |
tar xvfz zfs-utils-linux-lts.tar.gz | |
cd zfs-utils-linux-lts | |
makepkg -sri | |
cd .. | |
echo "${GREEN} >> installing zfs-linux-lts...${NC}" | |
wget https://aur.archlinux.org/cgit/aur.git/snapshot/zfs-linux-lts.tar.gz | |
tar xvfz zfs-linux-lts.tar.gz | |
cd zfs-linux-lts | |
makepkg -sri | |
cd .. | |
echo "${GREEN} >> enable zfs kernel module${NC}" | |
sudo modprobe zfs | |
echo "${GREEN} >> start zed service${NC}" | |
sudo systemctl start zed.service | |
echo "${GREEN} >> import zpoo${NC}" | |
sudo zpool import tank | |
echo "${GREEN} >> start fileserver frontend${NC}" | |
sudo systemctl start file-server-frontend.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment