From 4bb18645e5809c43b5e068e73d7803d2826c9e7f Mon Sep 17 00:00:00 2001 From: KemoNine Date: Fri, 12 Apr 2019 00:48:37 +0100 Subject: [PATCH] Add notes on zfs and moving /var/log for advanced and storage focused users --- advanced/var_log_move.md | 26 ++++++++++ advanced/zfs.md | 107 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 advanced/var_log_move.md create mode 100644 advanced/zfs.md diff --git a/advanced/var_log_move.md b/advanced/var_log_move.md new file mode 100644 index 0000000..85c04bc --- /dev/null +++ b/advanced/var_log_move.md @@ -0,0 +1,26 @@ +# Move ```/var/log``` + + You can disable logging to ram by setting `ENABLED=false´ in `/etc/default/armbian-ramlog´. + +``` bash + +systemctl stop rsyslog.service +systemctl stop syslog.socket +lsof /var/log # (make sure it's empty) +systemctl stop log2ram +systemctl disable log2ram +systemctl stop armbian-ramlog.service +systemctl disable armbian-ramlog.service +systemctl stop armbian-zram-config.service +systemctl disable armbian-zram-config.service +nano -w /etc/default/armbian-ramlog + # Disable +nano -w /etc/default/armbian-zram-config + # Disable if *not* using swap in ram + +mv /var/log /var/oldlog +mkdir /var/log +rsync -aPr /var/oldlog/ /var/log/ +systemctl reboot + +``` \ No newline at end of file diff --git a/advanced/zfs.md b/advanced/zfs.md new file mode 100644 index 0000000..cb1471e --- /dev/null +++ b/advanced/zfs.md @@ -0,0 +1,107 @@ +# ZFS + +How to setup zfs on 64 bit arm boards. + +*Note: this is wholly untested and likely to be broken on 32 bit arm boards* + +## Initial Install / Setup + +``` bash + +apt-add-repository universe +apt install zfs-dkms spl-dkms zfsutils-linux +cat > /etc/modprobe.d/zfs.conf <> /etc/fstab +echo /dev/zvol/tank/swap/swap.2 none swap defaults 0 0 >> /etc/fstab +swapon -af + +nano -w /etc/fstab # Add above swap and remove exiting ones + +nano -w /etc/default/armbian-zram-config + # Disabe if NOT using /var/log in RAM + +``` + +## Regular scrubs and integrity checks + +``` bash + +crontab -e +22 0 14 * * /sbin/zpool scrub tank + +``` + +## Bulk storage and Samba filesystem shares + +``` bash + +# Samba toolchain +apt install samba tdb-tools + +# Samba user setup +useradd -g users -s /usr/sbin/nologin [username] +passwd [username] +smbpasswd -a [username] + +nano -w /etc/samba/smb.conf +workgroup = non-default +comment out all share definitions + +systemctl restart smbd + +# Bulk storage for all the things +zfs create -o sharesmb=on tank/downloads +zfs create -o sharesmb=on tank/scratch + +cat /var/lib/samba/usershares/* + +```