Post-Install: Storage

Settings post-install Proxmox~12 min

What this category covers

Four storage-related optimizations: tune the ZFS ARC cache size to a sensible fraction of host RAM, install and schedule ZFS auto-snapshots, enable ZFS autotrim on SSD/NVMe pools, and remove throttles from vzdump so backups run at full speed. All four are independent — pick the ones that match your setup. A fifth storage-adjacent optimization, Log2RAM, reduces SSD/NVMe wear by moving /var/log to a ramdisk — it lives on the Optional page because the ProxMenux Customizable menu groups it there.

All four are tracked in the Uninstall menu

Each of these options registers a tool in installed_tools.json, so they appear in Uninstall Optimizations. Reverting zfs_arc removes /etc/modprobe.d/99-zfsarc.conf and rebuilds initramfs; zfs_auto_snapshot purges the package (and its cron files) without asking; zfs_autotrim sets autotrim=off on the pools it enabled; vzdump_speed restores /etc/vzdump.conf from the .bak the install created.

Optimize ZFS ARC size

The Adaptive Replacement Cache (ARC) is ZFS’s in-memory read cache. Proxmox VE installations since 8.1 set a limit of 10% of RAM, capped at 16 GiB; older or upgraded hosts may differ. This option writes that same policy explicitly (RAM/10, capped at 16 GiB, with a 64 MiB floor) to its own file, which also covers older or upgraded hosts. Check existing settings and workload needs before changing it; a smaller cache is not always faster.

Sizing rules

Host RAMARC cap
FormulaRAM / 10, capped at 16 GiB, with a 64 MiB floor
8 GB host≈ 819 MiB (RAM/10)
16 GB host≈ 1.6 GiB (RAM/10)
64 GB host≈ 6.4 GiB (RAM/10)
≥ 160 GB host16 GiB (cap)

The file /etc/modprobe.d/99-zfsarc.conf contains a single directive — options zfs zfs_arc_max=…. This option does not tune other ZFS module parameters (zfs_arc_min, L2ARC prefetch/write throttle, TXG timeout). Before writing, a reconcile step scans other *.conf in /etc/modprobe.d/ that set zfs_arc_min / zfs_arc_max, backs them up to /usr/local/share/proxmenux/backups/zfs_arc/ with a manifest, and removes the conflicting zfs_arc_min / zfs_arc_max values (other options on those lines are kept), so only ProxMenux’s ARC file sets the limit. After writing, it runs update-initramfs -u -k all and, when applicable, proxmox-boot-tool refresh, so the limit also reaches the initramfs used by ZFS-on-root setups.

Requires a reboot to take effect

ARC settings are read when the zfs kernel module loads. To make the cap take effect on ZFS-on-root hosts, ProxMenux regenerates the initramfs with update-initramfs -u -k all and, when applicable, refreshes the boot loader with proxmox-boot-tool refresh. A reboot is still required to pick up the new module parameter; the "reboot required" flag is set automatically.

Safe on non-ZFS hosts

The function only writes the config when zpool list reports at least one imported ZFS pool. On ext4 / LVM-only Proxmox hosts, or on machines with the ZFS tools installed but no pool imported, ticking this option is a no-op — nothing gets written.

Verification and manual rollback

# Check the config file is in place
cat /etc/modprobe.d/99-zfsarc.conf

# After reboot, check actual ARC limits (in bytes)
cat /sys/module/zfs/parameters/zfs_arc_min
cat /sys/module/zfs/parameters/zfs_arc_max

# Manual rollback
rm /etc/modprobe.d/99-zfsarc.conf
update-initramfs -u -k all
# (reboot for ZFS to load with defaults again)

Install ZFS auto-snapshot

Installs the zfs-auto-snapshot package and rewrites its cron schedules so snapshots are taken automatically at several intervals. A great no-effort safety net on top of your regular vzdump backups.

Snapshot cadence ProxMenux configures

LabelRunsSnapshots kept
frequentevery 15 min4
hourlyevery hour1
dailyonce a day1
weeklyonce a week1
monthlyonce a month1

Conservative keep counts

ProxMenux ships with conservative retention (just 4 frequent + 1 of each longer interval) so ZFS snapshot storage doesn't balloon. If you want longer retention, edit the numbers in /etc/cron.d/zfs-auto-snapshot, /etc/cron.hourly/zfs-auto-snapshot, etc. after the script runs.

Only useful on ZFS pools

Installing the package on an ext4-only host is harmless but pointless — there are no ZFS datasets for it to snapshot. Skip this option if you don't use ZFS.

Verification and manual rollback

# List existing auto-snapshots across all ZFS datasets
zfs list -t snapshot | grep zfs-auto-snap

# Check the schedules
grep . /etc/cron.d/zfs-auto-snapshot /etc/cron.hourly/zfs-auto-snapshot \
       /etc/cron.daily/zfs-auto-snapshot /etc/cron.weekly/zfs-auto-snapshot \
       /etc/cron.monthly/zfs-auto-snapshot

# Manual rollback (removes the package + destroys no snapshots)
apt purge zfs-auto-snapshot
# Existing snapshots remain on your pools unless you destroy them explicitly

Enable ZFS autotrim (SSD/NVMe pools)

Enables the autotrim property on ZFS pools backed exclusively by SSDs or NVMe drives with TRIM support. The script conservatively skips pools containing a rotational device. Pools already set to autotrim=on are left unchanged.

What TRIM does, and why it matters on ZFS

SSDs / NVMe drives manage internal storage in fixed-size erase blocks that are much larger than the logical sectors the filesystem talks to. When a filesystem deletes a file, the drive doesn't know — it still thinks those sectors are in use, so its internal garbage collector keeps shuffling stale data around to free new erase blocks. TRIM is the standard command the OS uses to tell the drive "these sectors are now free, you can erase them ahead of time".

Without TRIM, SSD performance degrades over time as the drive runs out of pre-erased blocks and has to do erase-on-write, and write amplification increases — both shortening the drive's useful life. With TRIM enabled, the drive can keep a healthy pool of empty blocks ready to write into.

With autotrim=on, ZFS trims recently freed space in the background, grouping ranges before issuing commands. A periodic zpool trim <pool> is another option. Autotrim avoids a separate schedule, but its performance impact depends on the devices; periodic manual trim may suit some lower-end drives better.

Why is this practical to enable?

  • Sustained write performance. TRIM can help a drive reclaim unused blocks efficiently. The benefit and any latency impact depend on the device and workload.
  • Drive longevity. Avoiding unnecessary internal copying can reduce write amplification and NAND wear. It does not guarantee a specific increase in drive lifespan.
  • No scheduled cron job to remember. Unlike a periodic zpool trim, autotrim is fire-and-forget — the pool handles it on its own.

When is this necessary?

  • Consider enabling it on ZFS pools made entirely of TRIM-capable SSD or NVMe devices. Check device behaviour and workload latency; a scheduled manual trim can be preferable on some hardware.
  • The script skips it automatically on:
    • Pools containing any HDD (rotational) vdev — a conservative hardware filter used by this script.
    • Drives without discard_granularity exposed in sysfs — usually old SSDs without TRIM, or pass-through paths where the OS can't see the underlying device.
    • Pools where ZFS itself reports the property unsupported (rare; very old pools).
    • Pools already set to autotrim=on (no-op).
  • Not relevant on ext4-only hosts — there's nothing for ZFS to trim. The function exits with a friendly message in that case.

Why only the pools ProxMenux changed are recorded

The function only writes a pool to its internal state file (/usr/local/share/proxmenux/zfs_autotrim_pools) when it actively flipped that pool from off to on. Pools you had on autotrim before running the script are left out of the list, so a future Uninstall doesn't turn off settings you configured yourself — only ProxMenux's own changes are reverted.

Manual equivalent (run on your server)

The full sequence the script runs against each pool is replicable by hand. This is what you would type if you wanted to do the same thing on a single pool without ProxMenux:

# 1. List your ZFS pools
zpool list -H -o name

# 2. Check the current autotrim setting on a pool
zpool get autotrim <pool>

# 3. Verify the pool is backed by SSD/NVMe with TRIM support
#    For each vdev (use the device path you see in 'zpool status -P <pool>'):
DEV=sda      # replace with the actual short name (sda, nvme0n1, ...)
cat /sys/block/${DEV}/queue/rotational           # must be 0 (SSD/NVMe, not HDD)
cat /sys/block/${DEV}/queue/discard_granularity  # must be > 0 (TRIM supported)

# 4. Turn it on
zpool set autotrim=on <pool>

# 5. Confirm
zpool get autotrim <pool>

Verification and manual rollback

# Verify autotrim is active on every pool ProxMenux touched
cat /usr/local/share/proxmenux/zfs_autotrim_pools
while read -r p; do
  zpool get autotrim "$p"
done < /usr/local/share/proxmenux/zfs_autotrim_pools

# Manual rollback — disable autotrim on a specific pool
zpool set autotrim=off <pool>

# Or revert all pools ProxMenux changed (manual equivalent of the Uninstall option)
while read -r p; do
  zpool set autotrim=off "$p"
done < /usr/local/share/proxmenux/zfs_autotrim_pools

Need a one-shot trim instead of continuous?

Some users prefer a manual trim during off-peak hours rather than continuous trim activity. Disable autotrim and schedule a cron job that runs zpool trim <pool> — same end goal, different cadence.

Increase vzdump backup speed

Writes bwlimit: 0 and ionice: 5 in the global vzdump configuration. Proxmox already defaults to no bandwidth limit, so this removes a cap only if one was configured. Compared with the default ionice: 7, the value 5 gives a higher best-effort I/O priority where the scheduler honours it. This can affect running guests and does not guarantee faster backups.

What gets changed in /etc/vzdump.conf

bwlimit: 0      # No bandwidth limit; replaces any configured global cap
ionice:  5      # Best-effort level 5; higher priority than the default 7 where supported

First run creates a .bak of vzdump.conf

The first time this option runs, ProxMenux copies /etc/vzdump.conf to /etc/vzdump.conf.bak before touching it. Subsequent runs re-use that backup and won't overwrite it, so a hand-edited config from before the first apply stays recoverable. The changes to bwlimit and ionice are then made with sed, and any other options in the file (compress, pigz, tmpdir, exclude-path, etc.) are preserved.

When to skip this

On a host with slow local storage and VMs that are latency-sensitive, removing the bandwidth cap can cause noticeable slowdowns during backups. If you've previously set a specific bwlimit for that reason, keep it — skip this option.

Verification and manual rollback

# Check current vzdump config
grep -E "^(bwlimit|ionice):" /etc/vzdump.conf

# Manual rollback (comment out the two lines — restores Proxmox defaults)
sed -i 's/^bwlimit: 0/#bwlimit: KBPS/' /etc/vzdump.conf
sed -i 's/^ionice: 5/#ionice: PRI/' /etc/vzdump.conf

Related