What are volumes?
Volumes in Zerobyte represent the source locations you want to back up. A volume is a mounted filesystem that Zerobyte can read from to create backups. Think of volumes as the “what” in your backup strategy — the data sources that need protection. Each volume can be a local directory, network share, or remote filesystem. Zerobyte handles the mounting and health monitoring automatically, ensuring your data is accessible when backup jobs run.Why volumes matter
Volumes provide a standardized abstraction layer over different storage protocols. Instead of managing mount points manually, Zerobyte:- Automatically mounts and unmounts filesystems based on backup schedules
- Monitors health status to detect connection issues before backups fail
- Encrypts sensitive credentials like passwords and private keys at rest
- Provides file browsing to help you configure inclusion and exclusion patterns
- Supports auto-remount to recover from transient network failures
Volume lifecycle
Every volume in Zerobyte follows this lifecycle:Status states
Volumes can be in one of three states:Mounted
The volume is successfully mounted and accessible at
/mnt/volumes/{shortId}. Backup jobs can read from this volume.Unmounted
The volume exists in Zerobyte but is not currently mounted. Backups cannot run until the volume is mounted.
Auto-remount
WhenautoRemount is enabled (default), Zerobyte automatically attempts to remount volumes that enter an error state. This is useful for:
- Network shares that experience temporary connectivity issues
- Remote filesystems that may disconnect during network maintenance
- Recovering from server restarts without manual intervention
Supported volume types
Zerobyte supports six volume backend types, each optimized for different use cases.Directory (local)
Mount a local directory on the host system. This is the simplest volume type and requires no network configuration. Use cases:- Backing up local application data
- Testing backup configurations
- Consolidating data from Docker volumes
Directory volumes mount using bind mounts. Ensure the path exists and the Zerobyte process has read access.
NFS (Network File System)
Mount network shares using NFS protocol. Zerobyte supports NFSv3, NFSv4, and NFSv4.1. Use cases:- Backing up NAS devices
- Enterprise file servers
- Shared storage in containerized environments
3- NFSv3 (maximum compatibility)4- NFSv4 (better security, stateful)4.1- NFSv4.1 (improved performance, pNFS support)
SMB (Server Message Block)
Mount Windows shares and Samba servers using the SMB/CIFS protocol. Use cases:- Windows file servers
- Samba shares on Linux/NAS
- Active Directory-integrated storage
1.0- Legacy (not recommended, security risks)2.0- SMB2 (minimum recommended)2.1- SMB2.1 (improved performance)3.0- SMB3 (encryption support)auto- Negotiate highest supported version
WebDAV
Mount WebDAV servers over HTTP/HTTPS. Useful for backing up cloud storage that exposes WebDAV endpoints. Use cases:- Nextcloud/ownCloud instances
- Web-based file storage
- Cloud providers with WebDAV support
WebDAV volumes mount using
davfs2. For HTTPS endpoints, ensure SSL certificates are valid or configure appropriate trust settings.SFTP (SSH File Transfer Protocol)
Mount remote directories via SSH. Supports both password and SSH key authentication. Use cases:- Remote Linux servers
- VPS data backups
- SSH-accessible storage
Rclone
Mount any rclone-supported backend as a volume. This provides access to 40+ cloud storage providers. Use cases:- Backing up cloud storage to encrypted repositories
- Consolidating data from multiple cloud providers
- Accessing exotic storage backends
How volumes work in Zerobyte
Under the hood, Zerobyte manages volumes through a sophisticated backend system:Mount point structure
All volumes are mounted under/mnt/volumes/{shortId} where {shortId} is a unique identifier assigned when the volume is created.
- No path conflicts between volumes
- Clean unmounting without affecting other volumes
- Consistent file browsing APIs across all backend types
Backend implementation
ThecreateVolumeBackend() function in app/server/modules/backends/backend.ts instantiates the appropriate backend driver based on volume type:
mount()- Establish the connection and mount the filesystemunmount()- Cleanly disconnect and unmountcheckHealth()- Verify the mount is still accessible
Security: Credential encryption
Sensitive fields like passwords and private keys are encrypted before storage using thecryptoUtils.sealSecret() function:
Health checks
Health checks run automatically and can be triggered manually. ThecheckHealth() operation:
- Attempts to stat the mount point using
getStatFs() - Verifies filesystem statistics are readable
- Updates
volume.statusandvolume.lastHealthCheck - Records any errors in
volume.lastError
File browsing
Zerobyte provides APIs to browse mounted volume contents, making it easy to:- Verify the volume mounted correctly
- Identify paths for inclusion/exclusion patterns
- Estimate backup sizes
listFiles() service method supports:
- Pagination with configurable offset and limit (max 500 items per page)
- Recursive directory traversal by specifying subpaths
- File metadata including size, type, and modification time
- Sorted output with directories listed before files
Read-only volumes
All volume types support areadOnly flag. When enabled:
- Restic can still read and back up files
- Write operations fail at the filesystem level
- Provides an extra safety layer for production data
Database schema
Volumes are stored in thevolumes_table with this structure:
Best practices
Name volumes descriptively
Name volumes descriptively
Use names that indicate what data the volume contains:
production-database-dumpscustomer-uploads-nfsaccounting-smb-share
volume1 or backup.Enable auto-remount for network volumes
Enable auto-remount for network volumes
Network shares can experience transient failures. Auto-remount ensures backups resume automatically after connectivity is restored.
Use read-only mode when possible
Use read-only mode when possible
Protect source data from accidental modification by enabling read-only mounting. This is especially important for:
- Production database backups
- Archive data
- Compliance-critical files
Test connections before creating volumes
Test connections before creating volumes
Use the “Test Connection” feature in the UI (or the API endpoint) to verify credentials and connectivity before saving the volume configuration.
Monitor volume health
Monitor volume health
Set up notifications for volume health check failures. A volume in error state will cause backup jobs to fail.
Minimize mount time
Minimize mount time
For security and resource efficiency, unmount volumes when backups aren’t running. This is handled automatically when volumes are only used by scheduled backups.
Next steps
Create a repository
Learn about backup repositories where your encrypted snapshots are stored
Set up backups
Configure backup schedules to protect your volumes
Volume management guide
Step-by-step instructions for adding and configuring volumes
Troubleshooting
Resolve common volume mounting issues
