How It Works
The volume system operates in two modes:- Runtime Detection - Automatically discovers all mounted storage devices
- Volume Tracking - Persists volumes you choose to track across sessions
Storage Backends
Spacedrive supports two types of storage backends:- Local Filesystems - Physical drives mounted on your system (APFS, NTFS, Ext4, etc.)
- Cloud Storage - S3, Google Drive, Dropbox, OneDrive, and 40+ other services via OpenDAL
Volume Identification
Each volume gets a unique fingerprint based on hardware identifiers, capacity, and filesystem type:Sync Ownership
Volumes serve as the ownership anchor for the sync system. Entries and locations reference a volume, inheriting ownership from the volume’s device. This indirection enables portable storage: when you plug an external drive into a different machine, updating the volume’s device reference transfers ownership of all associated files instantly. No bulk updates needed.See Library Sync for details on how ownership flows through volumes and enables seamless device transfers.
Unified Addressing
Spacedrive uses service-native URIs for cloud volumes that match industry tools:Volume Types
Mount Types
- System - Root filesystem and boot partitions
- External - USB drives and removable storage
- Network - NFS, SMB mounts
- Cloud - Cloud storage services (S3, Google Drive, Dropbox, OneDrive, etc.)
Disk Types
- SSD - Solid state drives with fast random access
- HDD - Traditional spinning disks
- Network - Remote storage over network
- Virtual - RAM disks and virtual filesystems
Filesystems
Spacedrive recognizes major filesystems including APFS, NTFS, Ext4, Btrfs, ZFS, FAT32, and ExFAT.Cloud Services
Supports 40+ cloud services via OpenDAL:- S3 - Amazon S3, Cloudflare R2, MinIO, Wasabi, Backblaze B2
- Google Drive - Consumer and Workspace accounts
- Dropbox - Personal and Business
- OneDrive - Personal and Business
- Google Cloud Storage - GCS buckets
- Azure Blob Storage - Azure containers
Using Volumes
Get Volume Information
Track Volumes
Convert a runtime-detected volume into a tracked volume:Add Cloud Volumes
Add cloud storage as a tracked volume:CLI Usage
Add cloud volumes from the command line:Volume Events
Monitor volume state changes:Copy-on-Write and Server-Side Operations
Spacedrive uses optimal copy strategies based on the storage backend:- COW copies on supported filesystems are nearly instant regardless of file size
- Server-side cloud copies avoid downloading/uploading data through your machine
- Cross-cloud operations automatically stream through local system
Smart File Operations
Volume awareness enables optimal file operations:Cloud-Specific Optimizations
Cloud volumes automatically use efficient operations:- Ranged Reads - Download only needed portions of files
- Content Hashing - Sample-based hashing uses ~58KB for large files
- Parallel Operations - Concurrent metadata and content fetches
- Metadata Caching - Reduces redundant API calls
Performance Monitoring
Test volume read/write speeds:Platform Detection
macOS
Usesdiskutil and df to detect APFS volumes and identify SSD/HDD types.
Linux
Parses/sys/block/ and df output for filesystem and disk type information.
Windows
Uses PowerShell cmdlets for volume enumeration (implementation pending).Cloud Storage
Uses OpenDAL for unified cloud service integration. Credentials are encrypted with library keys and stored securely in the OS keyring.Supported Cloud Services
Fully integrated and tested:- S3 and Compatible - Amazon S3, Cloudflare R2, MinIO, Wasabi, Backblaze B2, DigitalOcean Spaces
- Google Drive
- Dropbox
- OneDrive
- Google Cloud Storage
- Azure Blob Storage
Credential Security
Cloud credentials are:- Encrypted with library-specific keys using XChaCha20-Poly1305
- Stored in OS keyring (Keychain on macOS, Credential Manager on Windows, Secret Service on Linux)
- Never written to disk in plaintext
- Automatically deleted when volumes are removed
Configuration
Cloud Volume Configuration
Cloud volumes require service-specific configuration:endpoint parameter enables use of S3-compatible services:
- Cloudflare R2:
https://<account>.r2.cloudflarestorage.com - MinIO:
http://localhost:9000or your server URL - Wasabi:
https://s3.<region>.wasabisys.com - Backblaze B2:
https://s3.<region>.backblazeb2.com - DigitalOcean Spaces:
https://<region>.digitaloceanspaces.com
Error Handling
Cloud-Specific Errors
Cloud volumes may encounter additional error conditions:Best Practices
Performance
- Cache volume lookups for hot paths
- Use COW or server-side operations when available
- Check space before large operations
- For cloud: Use ranged reads for metadata extraction
User Experience
- Show tracking prompts for new external drives
- Display volume capacity and network status in the UI
- Allow custom naming and organization
- Show cloud sync status and quota information
Reliability
- Handle disconnections gracefully (especially for cloud)
- Validate fingerprints before operations
- Monitor available space and network connectivity
- Implement retry logic for transient cloud errors
Security
- Store cloud credentials encrypted in OS keyring using XChaCha20-Poly1305
- Use library-specific encryption keys for credential protection
- Credentials are bound to both library ID and volume fingerprint
- OAuth 2.0 with PKCE support planned for Google Drive, Dropbox, OneDrive
- Never log credentials, tokens, or sensitive configuration
- Automatic credential cleanup when volumes are removed
Common Patterns
Adding Locations
When users add a location, suggest tracking its volume:Space Checks
Before large operations:Volume Statistics
Tracked volumes maintain statistics:- Total files and directories
- Read/write performance metrics (local) or API latency (cloud)
- Last seen timestamp
- Last sync timestamp (for cloud volumes)
- User preferences (favorite, color, icon)
Content Deduplication Across Storage
Spacedrive uses consistent content hashing across all storage backends:- Identify duplicates between local drives and cloud storage
- Skip uploading files that already exist in cloud
- Find files across all storage locations using content hash
Large files (>100KB) use sample-based hashing, transferring only ~58KB for content identification regardless of file size. This makes cloud indexing efficient even on slow connections.
