Scans and ingest
Scanning on a schedule, automatic ingest, what to keep, and checking the numbers.
Scans
Weekly scans suit most research filesystems; nightly ones suit smaller filesystems or ones you watch closely. A scan of a billion files takes hours, so each scan gets its own folder, and only scans that verify are loaded.
pinax-ingest looks for scan folders (with a manifest.json) up to three levels below PINAX_SCAN_ROOT, oldest first, and treats each by the status fs-inventory gave it:
| Status | What the watcher does |
|---|---|
complete | runs fs-inventory verify, then ingests it (skip the verify with --no-verify) |
running, interrupted | leaves it alone and looks again next time, since it may still finish or be resumed |
incomplete, failed | records it on Scans as skipped, with why (--allow-incomplete ingests incomplete ones) |
A scan is matched to its filesystem by its root, and is handled once: ingested, skipped, or failed with the error, all of which show on Scans. A failed or skipped scan is never retried automatically; fix the cause and run pinax ingest SCAN_DIR by hand. Scans whose root matches no registered filesystem are named in the watcher's log and left for later. Any number of watchers and manual ingests may run at once: they share a lock in PINAX_VAR_ROOT, so one index is built at a time and no scan is ingested twice.
Scans also shows whether the watcher is alive: it reports what it is doing at every pass, and is shown as not responding when it misses three. To run it from a timer instead of as a service, use --once with the timer's interval as --interval; it exits with code 1 when a scan in that pass failed.
A scan host other than the Pinax server can scan and verify, and write into the watched folder:
dir=/scans/fast/$(date -u +%Y%m%dT%H%M%SZ)/opt/fs-inventory/fs-inventory scan /fh/fast -o "$dir" --resolve-ids --threads 64 --stall-timeout 15m && /opt/fs-inventory/fs-inventory verify "$dir"Notes:
--resolve-idsrecords owner names, which the Owners report and storage health use to flag deleted accounts. Run it on a host that resolves the same accounts as the storage (LDAP or sssd).fs-inventory probe /fh/fast --threads 16,32,64,128finds a good thread count without writing anything;PINAX_SCAN_THREADSsets it forpinax scan.- An interrupted scan can be continued with
fs-inventory resume; the watcher waits for it. pinax scanalso asks the filesystem for its total, used, and available space (statvfs, which reads no file) and writes them topinax.jsonbeside the manifest, so Capacity knows how much the filesystem holds and how much of it the storage counts as used, its snapshots included. A scan made with fs-inventory directly, as above, has none: set the filesystem's capacity on Capacity instead (a capacity set there also takes the place of what the storage reports, for storage whose mount shows a quota or a shared pool).- Pinax never deletes scan folders. Keep the scan of every snapshot that still has its index (the newest
PINAX_KEEP_SNAPSHOTSof each filesystem), so it can be rebuilt after an upgrade and checked; once a snapshot is pruned, its scan is of no further use to Pinax and can be deleted.pinax snapshotslists each snapshot's status (readyorpruned) and scan folder. See What Pinax keeps. - Pinax reads only the parts a scan's manifest lists, so leftovers of an interrupted run in the folder are ignored.
- fs-inventory does not enter other filesystems mounted below the root unless asked. If labs' folders are their own filesystems (filesets, exports, automounts), scan with
--cross-mounts(add it toPINAX_SCAN_EXTRA_ARGS); otherwise each is counted as a folder not read, with nothing in it, and Pinax says its totals are lower bounds. - Scans in microseconds (the default) and in nanoseconds (
--time-unit ns) are both accepted.
Checking a filesystem's numbers
After the first scan of a filesystem, and after upgrading Pinax, check the index against fs-inventory's own computation of the same totals with pinax check SNAPSHOT_ID. It runs fs-inventory rollup on a copy of the scan's manifest (the scan folder is not written to) and compares every directory, printing the ones that differ. Rollup keeps an age histogram of about 0.5 KB for every directory down to the depth compared, so on scans with tens of millions of directories bound it, for example --age-depth 4; the other totals are still compared at every depth. Each index also records how every directory changed since the filesystem's previous scan, and the check compares that too, with a rollup of the previous scan, as long as its scan folder is kept.