Since v0.9, Garage natively supports nodes with multiple storage drives for data blocks (metadata storage still uses a single location).Documentation Index
Fetch the complete documentation index at: https://mintlify.com/deuxfleurs-org/garage/llms.txt
Use this file to discover all available pages before exploring further.
Initial Setup
To configure a Garage node with multiple HDDs:- Format and mount all drives in different directories
- Configure Garage with multiple data directories:
Example Configuration
- hdd1 stores ~25% of data (2TB of 8TB total)
- hdd2 stores ~25% of data (2TB of 8TB total)
- hdd3 stores ~50% of data (4TB of 8TB total)
How Multi-HDD Works
Hash Slice Distribution
Garage divides all possible block hashes into 1024 fixed slices and assigns each slice a primary storage location among your data directories. The number of slices per directory is proportional to its specified capacity.Write Operations
When Garage receives a block to write:- It calculates which slice the block hash belongs to
- It writes the block to that slice’s primary directory
Read Operations
When Garage needs to read a block:- It checks the primary directory for the block’s slice
- If not found, it checks secondary directories
- Secondary directories are previous primary locations where the block might still exist
This strategy allows adding storage locations without immediately moving all existing data.
Adding Storage Locations
When you add new storage locations, Garage does not automatically rebalance existing data.What Happens
- Newly written blocks are balanced proportionally to all specified capacities
- Existing data stays in its current location
- Opportunistic rebalancing occurs when blocks are re-written (e.g., object re-upload)
Example
Original configuration:- hdd1 contains all old data
- New blocks are split 50/50 between hdd1 and hdd2
- Old blocks remain on hdd1 until rebalanced
Rebalancing Strategies
Lazy Rebalancing (Automatic)
When a block is re-written:- Garage checks if it’s in the primary directory
- If it’s in a secondary directory, Garage:
- Writes a new copy to the primary directory
- Deletes the secondary copy
- No manual intervention
- No performance impact
- Blocks that are only read (never written) remain unbalanced
- May never achieve full balance
Active Rebalancing (Manual)
Explicitly launch a rebalance operation:- Moves all blocks to their primary locations
- Removes secondary location information
- Ensures optimal distribution
- After adding storage locations
- After changing capacity values
- To move data out of read-only locations
- To optimize read performance
Once active rebalancing completes, Garage knows exactly where each block is located, improving access speed.
Read-Only Storage Locations
Use read-only mode to migrate data from an old drive to new drives.Configuration
Behavior
- Reads: Garage can read blocks from the read-only directory
- Writes: No new blocks are written to the read-only directory
- Lazy rebalancing: Blocks are gradually moved to primary directories
- Active rebalancing: Moves all data out immediately
Migration Process
- Mark old drive as read-only in configuration
- Restart Garage to apply changes
- Run active rebalance:
- Verify drive is empty:
- Remove from configuration:
- Restart Garage
The old directory may still contain empty subdirectories. These can be safely deleted after removal from the configuration.
Monitoring Multi-HDD Setup
Check Disk Space
Garage exports metrics for each volume:Monitor Rebalance Progress
During active rebalancing:Check Block Distribution
View block manager statistics:Best Practices
1. Use Similar Drive Sizes
For best balance, use drives of similar capacity. If using mixed sizes, larger drives will store proportionally more data.2. Set Realistic Capacities
Don’t specify the full drive capacity - leave room for:- Filesystem overhead (5-10%)
- Temporary files
- Future growth
3. Plan Capacity Changes
When adjusting capacities:- Update configuration
- Restart Garage
- Run
garage repair rebalance - Monitor until completion
4. Test Drive Failures
Simulate drive failures to verify:- Garage continues operating with remaining drives
- Read-only mode works as expected
- Data migration completes successfully
5. Monitor Drive Health
Use SMART monitoring:6. Document Your Setup
Keep records of:- Drive serial numbers and mount points
- Capacity allocations
- Last rebalance dates
- Migration history
Troubleshooting
Drive Full Despite Available Capacity
Cause: Imbalanced distribution due to missing rebalance. Solution:Rebalance Not Completing
Cause: Active I/O or large dataset. Solution:- Check
garage worker listfor worker status - Monitor with
garage stats -a - Be patient - rebalancing terabytes takes time
Cannot Remove Old Drive from Configuration
Cause: Data still present on the drive. Solution:-
Verify drive is truly empty:
-
If files remain, run rebalance again:
New Drive Not Receiving Data
Cause: Configuration not reloaded or rebalance not run. Solution:- Restart Garage to reload configuration
- Verify configuration with
garage status - Run
garage repair rebalance
Limitations
Performance Considerations
Sequential vs. Random I/O
- Sequential writes: Performance scales with number of drives
- Random reads: May benefit from parallel drive access
- Small objects: More drives provide better concurrency
Drive Speed Mixing
You can mix HDD and SSD for data storage:Blocks are randomly distributed, so frequently accessed data won’t automatically stay on the SSD. For consistent performance, use all SSDs or all HDDs.