Scrub and Trim dont seem to be excecuted by timers

Jeffreynl

New Member
Oct 23, 2022
3
0
1
Hi all,

I'm new to the Proxmox VE system and Forums so if my method of posting is incorrect please let me know!

I have setup a proxmox VE host machine with two ZFS pools:
  • rpool: 2 * 500GB SSD ZFS0, this stores the Proxmox OS and the VM's
  • StoragePool: 5* 4TB HDD ZFS2, this contains the large data disks of some VM's
I've read some things about how to correctly maintain a ZFS pool, these are TRIM, to correctly free up dicarded space by the VM's for the ssd's, and Scrubbing to prevent bit rot.
i've found a way to manualy do a scrub and trim with: 'zpool trim rpool' and: '/usr/lib/zfs-linux/scrub', when i checked the state with: 'zpool status -t' i was seeing indeed that the Scrub and Trim were being excecuted, and the timespamp when done was changed to 'now'.

After some more reading i read in the forms that these two actions are already performed automaticly by timers. when i checked the timer status with: 'systemctl list-timers --all' i saw the timers are enabled, and sceduled in a few days.
When i checked the timer status after the were scheduled a few days later, it said the trim and Scrub timers were run (passed), but the timestamps listed in 'zpool status -t' were still unchanged since the last time that i ran the scrub/trim manually.

Am i missing something or are the scrub and trim on the timers not excecuting correctly?
 
Hi,
After some more reading i read in the forms that these two actions are already performed automaticly by timers. when i checked the timer status with: 'systemctl list-timers --all' i saw the timers are enabled, and sceduled in a few days.
What is the output of pveversion -v and systemctl status zfs-scrub-weekly@rpool.timer zfs-scrub-monthly@rpool.timer zfs-scrub-weekly@StoragePool.timer zfs-scrub-monthly@StoragePool.timer? I'm not aware of a timer for ZFS trim on default installations.
 
Output of pveversion -v:
Code:
proxmox-ve: 7.2-1 (running kernel: 5.15.30-2-pve)
pve-manager: 7.2-3 (running version: 7.2-3/c743d6c1)
pve-kernel-helper: 7.2-2
pve-kernel-5.15: 7.2-1
pve-kernel-5.15.30-2-pve: 5.15.30-3
ceph-fuse: 15.2.16-pve1
corosync: 3.1.5-pve2
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown2: 3.1.0-1+pmx3
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-1
libknet1: 1.22-pve2
libproxmox-acme-perl: 1.4.2
libproxmox-backup-qemu0: 1.2.0-1
libpve-access-control: 7.1-8
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.1-6
libpve-guest-common-perl: 4.1-2
libpve-http-server-perl: 4.1-1
libpve-storage-perl: 7.2-2
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 4.0.12-1
lxcfs: 4.0.12-pve1
novnc-pve: 1.3.0-3
proxmox-backup-client: 2.1.8-1
proxmox-backup-file-restore: 2.1.8-1
proxmox-mini-journalreader: 1.3-1
proxmox-widget-toolkit: 3.4-10
pve-cluster: 7.2-1
pve-container: 4.2-1
pve-docs: 7.2-2
pve-edk2-firmware: 3.20210831-2
pve-firewall: 4.2-5
pve-firmware: 3.4-1
pve-ha-manager: 3.3-4
pve-i18n: 2.7-1
pve-qemu-kvm: 6.2.0-5
pve-xtermjs: 4.16.0-1
qemu-server: 7.2-2
smartmontools: 7.2-pve3
spiceterm: 3.2-2
swtpm: 0.7.1~bpo11+1
vncterm: 1.7-1
zfsutils-linux: 2.1.4-pve1


Output of systemctl status zfs-scrub-weekly@rpool.timer zfs-scrub-monthly@rpool.timer zfs-scrub-weekly@StoragePool.timer zfs-scrub-monthly@StoragePool.timer:
Code:
● zfs-scrub-weekly@rpool.timer - Weekly zpool scrub timer for rpool
     Loaded: loaded (/lib/systemd/system/zfs-scrub-weekly@.timer; disabled; vendor preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● zfs-scrub@rpool.service
       Docs: man:zpool-scrub(8)

● zfs-scrub-monthly@rpool.timer - Monthly zpool scrub timer for rpool
     Loaded: loaded (/lib/systemd/system/zfs-scrub-monthly@.timer; disabled; vendor preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● zfs-scrub@rpool.service
       Docs: man:zpool-scrub(8)

● zfs-scrub-weekly@StoragePool.timer - Weekly zpool scrub timer for StoragePool
     Loaded: loaded (/lib/systemd/system/zfs-scrub-weekly@.timer; disabled; vendor preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● zfs-scrub@StoragePool.service
       Docs: man:zpool-scrub(8)

● zfs-scrub-monthly@StoragePool.timer - Monthly zpool scrub timer for StoragePool
     Loaded: loaded (/lib/systemd/system/zfs-scrub-monthly@.timer; disabled; vendor preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● zfs-scrub@StoragePool.service
       Docs: man:zpool-scrub(8)

The Timers above seem diferent than the timers i've seen, are the timer, i was lead to belive the timer e2scrub_all.timer and fstrim.timer were handeling the trim and scrubbing.

Code:
NEXT                         LEFT        LAST                         PASSED       UNIT                         ACTIVATES
Mon 2022-10-24 22:15:58 CEST 11h left    Sun 2022-10-23 22:15:58 CEST 12h ago      systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Tue 2022-10-25 00:00:00 CEST 13h left    Mon 2022-10-24 00:00:17 CEST 10h ago      logrotate.timer              logrotate.service
Tue 2022-10-25 00:00:00 CEST 13h left    Mon 2022-10-24 00:00:17 CEST 10h ago      man-db.timer                 man-db.service
Tue 2022-10-25 02:21:24 CEST 15h left    Mon 2022-10-24 08:00:56 CEST 2h 46min ago apt-daily.timer              apt-daily.service
Tue 2022-10-25 02:43:58 CEST 15h left    Mon 2022-10-24 01:27:56 CEST 9h ago       pve-daily-update.timer       pve-daily-update.service
Tue 2022-10-25 06:43:42 CEST 19h left    Mon 2022-10-24 06:20:56 CEST 4h 26min ago apt-daily-upgrade.timer      apt-daily-upgrade.service
Sun 2022-10-30 03:10:12 CET  5 days left Sun 2022-10-23 03:10:21 CEST 1 day 7h ago e2scrub_all.timer            e2scrub_all.service
Mon 2022-10-31 00:02:57 CET  6 days left Mon 2022-10-24 00:31:58 CEST 10h ago      fstrim.timer                 fstrim.service

8 timers listed.
 
Output of systemctl status zfs-scrub-weekly@rpool.timer zfs-scrub-monthly@rpool.timer zfs-scrub-weekly@StoragePool.timer zfs-scrub-monthly@StoragePool.timer:
Code:
● zfs-scrub-weekly@rpool.timer - Weekly zpool scrub timer for rpool
     Loaded: loaded (/lib/systemd/system/zfs-scrub-weekly@.timer; disabled; vendor preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● zfs-scrub@rpool.service
       Docs: man:zpool-scrub(8)

● zfs-scrub-monthly@rpool.timer - Monthly zpool scrub timer for rpool
     Loaded: loaded (/lib/systemd/system/zfs-scrub-monthly@.timer; disabled; vendor preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● zfs-scrub@rpool.service
       Docs: man:zpool-scrub(8)

● zfs-scrub-weekly@StoragePool.timer - Weekly zpool scrub timer for StoragePool
     Loaded: loaded (/lib/systemd/system/zfs-scrub-weekly@.timer; disabled; vendor preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● zfs-scrub@StoragePool.service
       Docs: man:zpool-scrub(8)

● zfs-scrub-monthly@StoragePool.timer - Monthly zpool scrub timer for StoragePool
     Loaded: loaded (/lib/systemd/system/zfs-scrub-monthly@.timer; disabled; vendor preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● zfs-scrub@StoragePool.service
       Docs: man:zpool-scrub(8)
You can enable one of these per pool. For the trim, you would need to create your own systemd unit and timer.

The Timers above seem diferent than the timers i've seen, are the timer, i was lead to belive the timer e2scrub_all.timer and fstrim.timer were handeling the trim and scrubbing.
With systemctl status e2scrub_all.service fstrim.service you can get a brief description of what they are for and the command they trigger.
 
  • Like
Reactions: Jeffreynl

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!