From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 279C61FF144 for ; Tue, 24 Mar 2026 15:09:19 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1FD8B14074; Tue, 24 Mar 2026 15:09:39 +0100 (CET) Date: Tue, 24 Mar 2026 15:08:59 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= Subject: Re: [PATCH proxmox-backup 5/5] api: set default fstrim schedule on datastore create To: Christian Ebner , pbs-devel@lists.proxmox.com MIME-Version: 1.0 User-Agent: astroid/0.17.0 (https://github.com/astroidmail/astroid) Message-Id: <1774361263.igjfxqrk2l.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774361295984 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.053 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 44TTMKIBKLEWGRWFMSJFJI6NBH32POXJ X-Message-ID-Hash: 44TTMKIBKLEWGRWFMSJFJI6NBH32POXJ X-MailFrom: f.gruenbichler@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On March 19, 2026 3:36 pm, Christian Ebner wrote: > Default to set a weekly fstrim schedule for newly created datastores. >=20 > Do not set when crating a datastore via the ZFS dialog, as it does > not support discard. that is not true, it just doesn't support triggering discard/trim via fstrim.. which might be true for other file systems as well, not sure? >=20 > Signed-off-by: Christian Ebner > --- > src/api2/config/datastore.rs | 1 + > src/api2/node/disks/directory.rs | 6 ++++-- > 2 files changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs > index b10b7fb0a..45df53c72 100644 > --- a/src/api2/config/datastore.rs > +++ b/src/api2/config/datastore.rs > @@ -336,6 +336,7 @@ pub fn create_datastore( > // clearing prune settings in the datastore config, as they are now = handled by prune jobs > let config =3D DataStoreConfig { > prune_schedule: None, > + fstrim_schedule: config.fstrim_schedule.or(Some("weekly".to_stri= ng())), > keep: KeepOptions::default(), > ..config > }; > diff --git a/src/api2/node/disks/directory.rs b/src/api2/node/disks/direc= tory.rs > index c37d65b8d..42cd1d2d7 100644 > --- a/src/api2/node/disks/directory.rs > +++ b/src/api2/node/disks/directory.rs > @@ -242,10 +242,12 @@ pub fn create_datastore_disk( > let lock =3D pbs_config::datastore::lock_config()?; > let datastore: DataStoreConfig =3D if removable_datastor= e { > serde_json::from_value( > - json!({ "name": name, "path": name, "backing-dev= ice": uuid }), > + json!({ "name": name, "path": name, "backing-dev= ice": uuid , "fstrim-schedule": "weekly" }), > )? > } else { > - serde_json::from_value(json!({ "name": name, "path":= mount_point }))? > + serde_json::from_value( > + json!({ "name": name, "path": mount_point, "fstr= im-schedule": "weekly" }), > + )? > }; > let (config, _digest) =3D pbs_config::datastore::config(= )?; > =20 > --=20 > 2.47.3 >=20 >=20 >=20 >=20 >=20 >=20