From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [RFC proxmox{,-backup} 0/6] add scheduled fstrim job for datastore's backing filesystems
Date: Thu, 19 Mar 2026 15:36:43 +0100 [thread overview]
Message-ID: <20260319143649.681937-1-c.ebner@proxmox.com> (raw)
As reported in the community forum [0], the default systemd service
to run fstrim does not cover datastores mounted via systemd mount
unit, since the fstrim command is invoked via:
```
fstrim --listed-in /etc/fstab:/proc/self/mountinfo ...
```
which however only considers the list up to the first non-empty
file according to the man page [1].
To allow for easy configuration of scheduled fstrims also on
filesystems backing datastores in PBS, implement a scheduled job
with per-datastore schedule configuration. Enable and default to
executing the fstrim job for new datastores (except crated via ZFS
dialog).
Open question remaining:
How to best handle datastores located on ZFS? Should the command default
to zpool trim? Should it set `autotrim=on` on datastore creation instead
and silently ignore as it is now?
[0] https://forum.proxmox.com/threads/181764/
[1] https://www.man7.org/linux/man-pages/man8/fstrim.8.html
proxmox:
Christian Ebner (1):
pbs-api-types: define fstrim schedule on datastore config
pbs-api-types/src/datastore.rs | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
proxmox-backup:
Christian Ebner (5):
tools: add helper to run fstrim command on path or mountpoint
api: config: expose fstrim schedule for datastores
bin: proxy: periodically schedule fstrim on datastore's filesystems
ui: expose per-datastore fstrim job schedule
api: set default fstrim schedule on datastore create
src/api2/config/datastore.rs | 10 ++++++
src/api2/node/disks/directory.rs | 6 ++--
src/bin/proxmox-backup-proxy.rs | 59 ++++++++++++++++++++++++++++++++
src/tools/disks/mod.rs | 10 ++++++
www/Makefile | 1 +
www/datastore/OptionView.js | 7 ++++
www/window/FstrimJobEdit.js | 27 +++++++++++++++
7 files changed, 118 insertions(+), 2 deletions(-)
create mode 100644 www/window/FstrimJobEdit.js
Summary over all repositories:
8 files changed, 134 insertions(+), 2 deletions(-)
--
Generated by murpp 0.9.0
next reply other threads:[~2026-03-19 14:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 14:36 Christian Ebner [this message]
2026-03-19 14:36 ` [PATCH proxmox 1/1] pbs-api-types: define fstrim schedule on datastore config Christian Ebner
2026-03-19 14:36 ` [PATCH proxmox-backup 1/5] tools: add helper to run fstrim command on path or mountpoint Christian Ebner
2026-03-19 14:36 ` [PATCH proxmox-backup 2/5] api: config: expose fstrim schedule for datastores Christian Ebner
2026-03-19 14:36 ` [PATCH proxmox-backup 3/5] bin: proxy: periodically schedule fstrim on datastore's filesystems Christian Ebner
2026-03-19 15:02 ` Christian Ebner
2026-03-19 14:36 ` [PATCH proxmox-backup 4/5] ui: expose per-datastore fstrim job schedule Christian Ebner
2026-03-19 14:36 ` [PATCH proxmox-backup 5/5] api: set default fstrim schedule on datastore create Christian Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260319143649.681937-1-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox