Scrubbing a Storage Pool – Scheduled (CLI)

Scrubbing a storage pool verifies the content by checking for errors. By default, scheduled storage pool scrubbing is enabled and set to every 30 days. Use the scrub_schedule property to specify a different scrub interval or to disable scrub scheduling.

You cannot change the scrub priority explicitly. Scrub priority is automatically adjusted based on the specified scrub interval, the progress of the scrub, and the system load. Scrub priority automatically increases on an idle system.

A scrubbing operation will not proceed if a scrubbing or resilvering is already in progress. If a scrubbing operation is in progress when a resilvering starts, the resilvering operation suspends the current scrubbing and restarts the scrubbing after the resilvering is complete.

  1. Go to configuration storage.
  2. Select the online pool to scrub as follows:
    • If you have a single pool, the pool name is not displayed, but it is selected.

    • If you have multiple pools, one of the pools is selected and displayed. Enter the set pool= command to specify a different pool.

    hostname:configuration storage (pool0)> set pool=pool1
                              pool = pool1
  3. Optional: Check the status of the last scrub.

    Use the ls, show, or get command to see when the last scrub completed in GMT (or how long it ran if it did not complete), and the number of errors that were reported by the scrub:

    hostname:configuration storage (pool1)> get scrub scrub_schedule
               scrub = scrub completed after 2d20h with 0 errors on Thu May  6 10:35:16 2022
      scrub_schedule = 30 days

    The zpool status command also reports the completion time of the last scrub, how long the scrub ran, and whether errors were found and repaired.

  4. Set a value for the scrub_schedule property.

    Set the value of the scrub_schedule property to off to disable scrub scheduling, for example if you prefer to perform a manual scrub.

    To enable scheduled storage pool scrubbing, set the value of the scrub_schedule property to the number of days between scheduled scrubs. You can set scrub_schedule to 15, 30, 45, 60, 75, or 90 days.

    hostname:configuration storage (p0)> set scrub_schedule=60
                              scrub_schedule = 60
    hostname:configuration storage (p0)> get scrub_schedule
                              scrub_schedule = 60 days