Overview
Thecloudstic check command verifies the integrity of your Cloudstic repository by walking the full reference chain from index/latest through snapshots, HAMT nodes, filemeta, content, and chunks. It detects:
- Missing objects
- Corrupt objects (hash mismatch)
- Unreadable objects (store errors, decryption failures)
- Broken references (dangling pointers)
Basic Usage
Terminal Output Examples
Successful Check (All Snapshots)
Successful Check (Single Snapshot)
Check with Errors
Deep Check with Data Verification
Command Flags
Re-hash all chunk data to verify byte-level integrity. This performs a full read of every chunk object and compares the computed SHA-256 hash against the object key.
This is a deep verification mode that downloads and hashes all backup data. It can be slow and expensive on cloud storage backends (e.g., S3 egress charges). Use for critical integrity checks or suspected corruption.
Check only the specified snapshot reference. Accepts:
- Full snapshot hash:
abc123def456... - Short hash prefix:
abc123 - Snapshot ref format:
snapshot/abc123def456...
Log detailed information about each object being verified. Shows the reference chain walk and individual object checks.
Global Flags
Storage backend type:
local, b2, s3, sftp.Local/SFTP path or B2/S3 bucket name.
Key prefix for B2/S3 objects.
Platform key (64 hex chars = 32 bytes).
Repository password for encrypted repositories.
24-word BIP39 recovery phrase.
AWS KMS key ARN for KMS-encrypted repositories.
Suppress progress output (keeps final summary).
Log every store request (network calls, timing, sizes).
Examples
Quick Integrity Check
Deep Byte-Level Verification
Check Specific Snapshot
Check with Verbose Logging
Check Remote S3 Repository
Deep Check with Debug Logging
How Check Works
Reference Chain Validation
cloudstic check validates the repository by walking the entire reference graph:
- Load
index/latest— Resolve the latest snapshot pointer - Load snapshot manifest — Parse snapshot metadata (timestamp, source, HAMT root)
- Walk HAMT tree — Traverse all internal and leaf nodes
- Verify filemeta — Check file metadata objects
- Verify content — Validate content manifests (chunk lists)
- Check chunk references — Ensure all chunks exist in the store
By default,
check verifies that all referenced objects exist and have correct content-addressed hashes (object key matches SHA-256 of content). It does not re-read chunk data unless -read-data is specified.Deep Verification Mode (-read-data)
When -read-data is enabled, check performs byte-level verification:
- Downloads each
chunk/<hash>object - Decrypts and decompresses the chunk data
- Computes SHA-256 hash of the plaintext
- Compares against the chunk reference hash
- Silent bit rot in storage
- Decryption key mismatches
- Decompression errors
- Storage backend corruption
Error Types
Check reports three classes of errors:Missing Objects
Corrupt Objects
Unreadable Objects
- Verify encryption credentials are correct
- Check network connectivity and storage backend health
- Retry the check operation
Use Cases
Periodic Integrity Audits
Runcheck on a schedule (e.g., weekly) to detect corruption early:
Post-Prune Verification
After pruning unused chunks, verify no live data was accidentally deleted:Pre-Restore Validation
Before a critical restore operation, ensure the target snapshot is intact:Disaster Recovery Testing
Validate that an offsite backup repository is readable and complete:Performance Considerations
Local Storage
- Reference check: Fast (seconds to minutes for large repos)
- Deep check (
-read-data): Limited by disk I/O (~200-500 MB/s on SSD)
Cloud Storage (S3, B2)
- Reference check: Moderate (depends on latency and object count; ~10-100 ms per object)
- Deep check (
-read-data): Slow and expensive- S3: ~$0.09/GB egress (AWS → internet)
- B2: First 1GB/day free, then ~$0.01/GB
- Bandwidth: Limited by connection speed and S3 rate limits
Troubleshooting
Check reports errors but I can restore fine
Possible cause: Errors are in old snapshots or unreferenced objects. Resolution: Runcloudstic forget to remove old snapshots, then cloudstic prune to clean up unreferenced objects.
Check hangs or is very slow
Possible cause: Network latency, large HAMT tree, or many small objects. Resolution:- Use
-verboseto see progress - Check network connectivity to storage backend
- Consider enabling packfiles (
-enable-packfile) for future backups to reduce object count
Error: Failed to init store
-store, -store-path, and backend-specific flags (e.g., -s3-endpoint, -sftp-host).
Exit Codes
- 0 — Check succeeded, no errors found
- 1 — Check failed (errors detected, store initialization failed, or command error)
Related Commands
- cloudstic init — Initialize repository before first check
- cloudstic prune — Remove unused chunks (run check after pruning)
- cloudstic list — List all snapshots before checking specific ones
- cloudstic restore — Restore data after verifying integrity