Skip to main content
The local storage backend stores backups on the local filesystem. It’s ideal for external drives, NAS devices, or development/testing.

Configuration

Basic Setup

Initialize a repository with local storage:
cloudstic init -store local -store-path /path/to/backup
The directory will be created automatically if it doesn’t exist.

Environment Variables

CLOUDSTIC_STORE
string
default:"local"
Storage backend type
CLOUDSTIC_STORE_PATH
string
default:"./backup_store"
Path to the backup directory

Examples

# Initialize on an external drive
cloudstic init -store local -store-path /mnt/backup-drive/cloudstic

# Backup to the external drive
cloudstic backup -source local -source-path ~/Documents

Features

Atomic Writes

The local store uses atomic writes for safety:
  1. Data is written to a temporary file with .tmp suffix
  2. The temporary file is renamed to the final path
  3. On POSIX systems, rename is atomic
This ensures backups are never corrupted by interrupted writes.

Directory Structure

The local store creates this structure:
backup_store/
├── chunk/
│   └── <sha256>           # Raw data chunks
├── content/
│   └── <sha256>           # Chunk manifests
├── filemeta/
│   └── <sha256>           # File metadata
├── node/
│   └── <sha256>           # HAMT nodes
├── snapshot/
│   └── <sha256>           # Snapshots
├── index/
│   ├── latest             # Latest snapshot pointer
│   ├── snapshots          # Snapshot catalog
│   └── packs              # Pack catalog (if packfiles enabled)
├── keys/
│   ├── 0-password         # Password key slot
│   └── 1-recovery         # Recovery key slot (optional)
└── config                 # Repository config

Performance

Local storage offers the best performance:
  • Fast I/O: Direct filesystem access
  • No network latency: Eliminates network round-trips
  • Efficient deduplication: Fast local lookups
For networked filesystems (NFS, CIFS), performance depends on network speed and latency.

Best Practices

Backup Media

Pros:
  • Fast local backups
  • No cloud costs
  • Physical control
Considerations:
  • Keep drive disconnected when not in use
  • Store securely (encryption protects data)
  • Test restore regularly

Permissions

Ensure the backup directory has appropriate permissions:
# Create with restricted permissions
mkdir -p /backup/cloudstic
chmod 700 /backup/cloudstic

# Initialize
cloudstic init -store local -store-path /backup/cloudstic

Monitoring Disk Space

Monitor available space to avoid backup failures:
# Check disk usage
df -h /backup/cloudstic

# Check repository size
du -sh /backup/cloudstic
Use cloudstic prune regularly to reclaim space from deleted snapshots.

Troubleshooting

Permission Denied

If you see “permission denied” errors:
# Check directory ownership
ls -la /path/to/backup

# Fix ownership if needed
sudo chown -R $USER:$USER /path/to/backup

Disk Full

If the backup fails with “no space left on device”:
  1. Check available space: df -h /backup
  2. Run prune to reclaim space: cloudstic prune
  3. Consider forgetting old snapshots: cloudstic forget --keep-last 10 --prune

Network Mount Issues

For network mounts that disconnect:
# Use autofs or systemd automount for reliability
# Example /etc/fstab entry:
//nas.local/backup /mnt/nas cifs credentials=/etc/nas.creds,uid=1000,gid=1000 0 0