Proxmox on SD card

I found a relatively easy way around this to reduce writes and increase performance overall using https://github.com/ecdye/zram-config package, which combines the functionality from zram-tools' zramswap service as well as log2ram's service, making configuration much simpler overall.

Unfortunately there is no pre-packaged deb, and the source package uses lzip which isn't by default included in proxmox, but the main downside is that the install process requires compiling, which adds many more packages to an otherwise lean system, just to build the overlayfs tools.

Code:
The following NEW packages will be installed:
  build-essential cpp cpp-12 dpkg-dev fakeroot g++ g++-12 gcc gcc-12 libabsl20220623 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libaom3 libasan8 libatomic1 libavif15 libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev libdav1d6 libde265-0 libdeflate0 libfakeroot libgav1-1
  libgcc-12-dev libgd3 libgomp1 libheif1 libisl23 libitm1 libjbig0 liblerc4 liblsan0 libmpc3 libmpfr6 libnsl-dev libquadmath0 librav1e0 libstdc++-12-dev libsvtav1enc1 libtiff6 libtirpc-dev libtsan2 libubsan1 libwebp7 libx265-199 libxpm4 libyuv0 linux-libc-dev make manpages-dev meson ninja-build patch rpcsvc-proto

The install itself is relatively straightforward, with all the customization within /etc/ztab which is by default setup for a raspberry pi:
Code:
apt -y install lzip
wget https://github.com/ecdye/zram-config/releases/download/v1.7.0/zram-config-v1.7.0.tar.lz
tar xvf zram*
cd zram-config-v1.7.0
bash install.bash
sed -i "s|^swap.*|swap    lzo-rle         0M              1T              32767           0               100|g" /etc/ztab
sed -i "s|^log.*|log     zstd            16G             32G             /var/log        /log.bind       /opt/zram/oldlog|g" /etc/ztab
echo "dir     zstd            50M             150M            /var/lib/pve-cluster    /pve-cluster.bind" >> /etc/ztab

Afterwards, with this config, writes are substantially minimized:
Code:
2025-02-21 14:27:21 root@c13:~# cat /etc/ztab |grepconf
swap    lzo-rle         0M              128G            32767           0               100
log     zstd            16G             32G             /var/log        /log.bind       /opt/zram/oldlog
dir     zstd            50M             150M            /var/lib/pve-cluster    /pve-cluster.bind
2025-02-21 14:27:28 root@c13:~# zramctl
NAME       ALGORITHM DISKSIZE   DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle         1T     4K   88B   12K      48 [SWAP]
/dev/zram1 zstd           32G 638.8M 97.3M  102M      48 /opt/zram/zram1
/dev/zram2 zstd          150M  15.8M  3.5M  4.1M      48 /opt/zram/zram2
2025-02-21 14:38:22 root@c13:~#
 
Last edited: