mirror of
https://github.com/bashclub/proxmox-zfs-postinstall.git
synced 2025-12-06 08:38:44 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
239715d536 | ||
|
|
b2044fcd0e | ||
|
|
e910ff1bee | ||
|
|
cd0d7e2189 | ||
|
|
48f01bf87c | ||
|
|
513e37246e | ||
|
|
613e379bfb | ||
|
|
66efc4ebbc | ||
|
|
8faef151e5 | ||
|
|
1f4e705594 |
@@ -1,10 +1,10 @@
|
||||
# proxmox-zfs-postinastall
|
||||
# proxmox-zfs-postinstall
|
||||
|
||||
This script installs and configures basic tools for running a Proxmox Server.
|
||||
Following settings are made:
|
||||
- Remove `pve-enterprise` repo
|
||||
- Add `pve-no-subscription` repo
|
||||
- Upgrade system to latest version
|
||||
- Install basic tools: `vim ifupdown2 net-tools dnsutils ethtool git curl unzip screen iftop lshw smartmontools nvme-cli lsscsi sysstat zfs-auto-snapshot`
|
||||
- Install basic tools: `vim ifupdown2 net-tools dnsutils ethtool git curl unzip screen iftop lshw smartmontools nvme-cli lsscsi sysstat zfs-auto-snapshot htop mc rpl`
|
||||
- Configure snapshot retention for `zfs-auto-snapshot`
|
||||
- Set limits for level 1 arc (`zfs_arc_min` and `zfs_arc_max`)
|
||||
|
||||
21
install.sh
21
install.sh
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define basic tools to install
|
||||
TOOLS="vim ifupdown2 net-tools dnsutils ethtool git curl unzip screen iftop lshw smartmontools nvme-cli lsscsi sysstat zfs-auto-snapshot"
|
||||
TOOLS="vim ifupdown2 net-tools dnsutils ethtool git curl unzip screen iftop lshw smartmontools nvme-cli lsscsi sysstat zfs-auto-snapshot htop mc rpl"
|
||||
|
||||
# Define zfs-auto-snapshot retention policy
|
||||
SNAP_FREQUENT=8
|
||||
@@ -14,8 +14,8 @@ SNAP_MONTHLY=3
|
||||
ZFS_ARC_MIN=128
|
||||
ZFS_ARC_MAX=256
|
||||
|
||||
# remove pve-enterprise repo and add pve-no-subscription repo
|
||||
rm -f /etc/apt/sources.list.d/pve-enterprise.list
|
||||
# disable pve-enterprise repo and add pve-no-subscription repo
|
||||
mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak
|
||||
echo "deb http://download.proxmox.com/debian/pve buster pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
|
||||
apt update
|
||||
|
||||
@@ -24,15 +24,15 @@ DEBIAN_FRONTEND=nonintercative DEBIAN_PRIORITY=critical apt -y -qq dist-upgrade
|
||||
DEBIAN_FRONTEND=nonintercative DEBIAN_PRIORITY=critical apt -y -qq install $TOOLS
|
||||
|
||||
# configure zfs-auto-snapshot
|
||||
sed -i 's/keep=4/keep=$SNAP_FREQUENT/g' /etc/cron.d/zfs-auto-snapshot
|
||||
sed -i 's/keep=24/keep=$SNAP_HOURLY/g' /etc/cron.hourly/zfs-auto-snapshot
|
||||
sed -i 's/keep=31/keep=$SNAP_DAILY/g' /etc/cron.hourly/zfs-auto-snapshot
|
||||
sed -i 's/keep=8/keep=$SNAP_WEEKLY/g' /etc/cron.weekly/zfs-auto-snapshot
|
||||
sed -i 's/keep=8/keep=$SNAP_MONTHLY/g' /etc/cron.monthly/zfs-auto-snapshot
|
||||
rpl "keep=4" "keep=$SNAP_FREQUENT" /etc/cron.d/zfs-auto-snapshot
|
||||
rpl "keep=24" "keep=$SNAP_HOURLY" /etc/cron.hourly/zfs-auto-snapshot
|
||||
rpl "keep=31" "keep=$SNAP_DAILY" /etc/cron.hourly/zfs-auto-snapshot
|
||||
rpl "keep=8" "keep=$SNAP_WEEKLY" /etc/cron.weekly/zfs-auto-snapshot
|
||||
rpl "keep=8" "keep=$SNAP_MONTHLY" /etc/cron.monthly/zfs-auto-snapshot
|
||||
|
||||
# set zfs_arc_limits
|
||||
ZFS_ARC_MIN_BYTES=$(($ZFS_ARC_MIN+1024*1024))
|
||||
ZFS_ARC_MAX_BYTES=$(($ZFS_ARC_MAX+1024*1024))
|
||||
ZFS_ARC_MIN_BYTES=$(($ZFS_ARC_MIN*1024*1024))
|
||||
ZFS_ARC_MAX_BYTES=$(($ZFS_ARC_MAX*1024*1024))
|
||||
|
||||
echo $ZFS_ARC_MIN_BYTES > /sys/module/zfs/parameters/zfs_arc_min
|
||||
echo $ZFS_ARC_MAX_BYTES > /sys/module/zfs/parameters/zfs_arc_max
|
||||
@@ -42,4 +42,3 @@ options zfs zfs_arc_min=$ZFS_ARC_MIN_BYTES
|
||||
options zfs zfs_arc_min=$ZFS_ARC_MAX_BYTES
|
||||
EOF
|
||||
update-initramfs -u -k all
|
||||
|
||||
|
||||
Reference in New Issue
Block a user