What is a Zpool scrub?

zpool scrub [ -s | -p ] [ -w ] pool Begins a scrub or resumes a paused scrub. The scrub examines all data in the specified pools to verify that it checksums correctly. For replicated (mirror or raidz) devices, ZFS automatically repairs any damage discovered during the scrub.

Does ZFS automatically scrub?

For replicated (mirror or raidz) devices, ZFS automatically repairs any damage discovered during the scrub. The zpool status command reports the progress of the scrub and summarizes the results of the scrub upon completion. Scrubbing and resilvering are very similar operations.

How long does a ZFS Scrub take?

Because it’s low-priority, it can take anywhere from 1 second to many weeks to complete, all depending on how much data and how busy your ZFSSA is.

How does ZFS scrub work?

Okay, so all jokes aside, ZFS scrub is the best way to handle the dreaded bit rot. Every time ZFS reads a block, it compares that block to its checksum and then automatically fixes it if need be. However there may be data that you write to your ZPool and then it doesn’t get read again for a very long time.

What is a Freenas scrub?

A “scrub” is when ZFS scans the data on a pool. Scrubs identify data integrity problems, detect silent data corruptions caused by transient hardware issues, and provide early disk failure alerts.

How often should I scrub Truenas?

Standard practice is twice a month each, on alternate weeks (scrub -> SMART long test -> scrub -> SMART long test -> …).

Does ZFS defrag?

Mainly because there’s no notion of online defragmentation in ZFS. That’s really only possible by copying the pool data to another pool or rewriting to new storage.

What is ZFS trim?

ZFS autotrim really is a continuous, opportunistic operation which run after a block/range was freed. From the man page: autotrim = on | off. When set to on space which has been recently freed, and is no longer allocated by the pool, will be periodically trimmed …

What does disk scrubbing do?

Disk scrubbing is a background process that reads disks during idle periods to detect irremediable read er- rors in infrequently accessed sectors. Timely detection of such latent sector errors (LSEs) is important to reduce data loss.

What does TrueNAS scrub do?

When TrueNAS performs a scrub, ZFS scans the data on a pool. Scrubs identify data integrity problems, detect silent data corruptions caused by transient hardware issues, and provide early disk failure alerts.

What is a zpool scrub and how to do it?

During a scrub a checksum is being calculated and compared to a known value. If the values differ, then zfs tries to correct the error with good data in the pool. We want to avoid silent data corruption, so we should scrub our zpool regularly. This can be done while the system is running and could easily be handled with a weekly cronjob.

What is ZFS scrubbing?

ZFS scrubbing is a process which detects and corrects silent data errors in the pool. During a scrub a checksum is being calculated and compared to a known value. If the values differ, then zfs tries to correct the error with good data in the pool.

How long does it take to scrub a ZFS pool?

How long the scrub takes depends on how much data is in your pool; ZFS only scrubs sectors where data is present so if your pool is mostly empty it will be finished fairly quickly. Time taken is also dependent on drive and pool performance; an SSD pool will scrub much more quickly than a spinning disk pool!

Does active scrubbing affect performance?

Scrubbing has a low priority so if the drives are being accessed while the scrub is happening there should be less impact on performance. It’s a good idea to automate the scrubbing process in case you forget – we will do a later post on just how to do that!