Network Configuration Storage Optimization - Hard Links
Config Hard Link: Optimizing Configuration Storage
Section titled “Config Hard Link: Optimizing Configuration Storage”The Config Hard Link feature reduces storage consumption for configuration backups by creating file system hard links instead of duplicate files when consecutive backups capture identical configurations. This optimization maintains complete version history while significantly reducing disk space usage for devices with stable configurations.
How Config Hard Link Works
Section titled “How Config Hard Link Works”When rConfig backs up a device configuration, it compares the new backup against the previous version. If the configurations are identical (same content, same hash), rConfig has two storage options:
Without Hard Link (traditional approach): Store a complete duplicate file for the new backup version. If daily backups run for 30 days with no configuration changes, 30 identical files consume 30× the storage.
With Hard Link (optimized approach): Create a hard link pointing to the existing file instead of duplicating it. The file system maintains one physical copy on disk with multiple directory entries (hard links) referencing it. Storage consumption: 1× the file size regardless of backup frequency.
Technical Background
Section titled “Technical Background”Hard links are file system-level references that allow multiple directory entries to point to the same physical data on disk. Unlike symbolic links (shortcuts), hard links are indistinguishable from the original file—deleting one hard link doesn’t affect others, and the physical data remains on disk until all hard links are removed.
For configuration backups, this means each backup version appears as a separate file in rConfig’s directory structure, maintains independent timestamps and metadata, and can be accessed or compared individually—all while the actual configuration data exists only once on disk.
Benefits of Config Hard Link
Section titled “Benefits of Config Hard Link”Storage Savings
Section titled “Storage Savings”Devices with stable configurations (edge routers, access switches with standard configs, infrastructure that rarely changes) generate identical backups daily. Without hard links, a device backing up daily for a year with minimal changes could consume 365× the configuration file size. With hard links, storage consumption approaches 1× file size plus storage for actual changes.
Example: 1000 edge switches, 50KB config each, daily backups, 90-day retention, 80% of configs unchanged daily:
- Without hard links: ~4.5GB daily × 90 days = 405GB
- With hard links: ~900MB for actual changes = 90% storage reduction
Performance Benefits
Section titled “Performance Benefits”Hard link creation is a metadata operation, orders of magnitude faster than copying large configuration files. This reduces backup execution time, particularly for large-scale deployments with thousands of daily backups.
Operational Consistency
Section titled “Operational Consistency”Hard links maintain the appearance of complete version history—every backup creates a “new file” from the user perspective. Configuration diffs, historical access, and compliance reporting work identically whether files are hard links or physical copies. Operations teams don’t need to change workflows or understand underlying storage optimization.
Enabling Config Hard Link
Section titled “Enabling Config Hard Link”System Requirements
Section titled “System Requirements”Hard links require file system support (ext4, XFS, NTFS, most modern file systems support hard links). Verify your rConfig server’s file system supports hard links before enabling this feature.
Configuration
Section titled “Configuration”Edit the rConfig environment configuration file:
# Navigate to rConfig installation directorycd /var/www/html/rconfig8/current
# Edit environment filenano .env
Add or modify the HARD_LINK setting:
HARD_LINK=true
Save the file and restart rConfig services:
# Restart PHP-FPMsystemctl restart php-fpm
# Restart web server (Apache or Nginx)systemctl restart nginx# ORsystemctl restart httpd
Verification
Section titled “Verification”After enabling, run a backup on a test device twice without making configuration changes:
- Navigate to device in rConfig UI
- Run manual backup
- Wait for completion
- Run manual backup again (configuration unchanged)
- Check device config history—second backup should show hard link indicator
Identifying Hard-Linked Configurations
Section titled “Identifying Hard-Linked Configurations”Visual Indicator
Section titled “Visual Indicator”Hard-linked configurations display a link icon (🔗) in the rConfig interface, providing immediate visual confirmation that the configuration uses storage optimization.

Hard link indicator (🔗) showing storage-optimized configuration version
Where the indicator appears:
- Device configuration history view
- Configuration comparison interfaces
- Configuration file listings
File System Verification
Section titled “File System Verification”To verify hard links at the system level:
# Check hard link count for a configuration filels -l /storage/app/rconfig/data/[category]/[device]/[year]/[month]/[day]/config_file.txt
# Output shows link count (number after permissions)-rw-r--r-- 5 www-data www-data 51234 Oct 02 14:35 config_file.txt ^ Link count = 5 (one original + 4 hard links)
A link count greater than 1 indicates the file has hard links.
Operational Considerations
Section titled “Operational Considerations”Storage Savings Vary by Environment
Section titled “Storage Savings Vary by Environment”Hard link effectiveness depends on configuration change frequency:
High savings environments:
- Stable edge infrastructure
- Standardized access layer devices
- Devices with infrequent configuration changes
- Long retention periods (90+ days)
Lower savings environments:
- Core network devices with frequent changes
- Devices under active configuration management
- Infrastructure with daily automated changes
- Short retention periods (7-30 days)
No Impact on Functionality
Section titled “No Impact on Functionality”Hard links are transparent to rConfig operations:
- Configuration diffs work identically
- Version history displays normally
- Configuration restore functions unchanged
- Compliance checking unaffected
- All features operate as if files are physical copies
Backup and Migration Considerations
Section titled “Backup and Migration Considerations”When backing up or migrating rConfig servers:
Standard file copy (cp, rsync without special flags): Breaks hard links, creating physical copies. This increases storage but ensures compatibility.
Hard link-aware copy (cp -a, rsync -H): Preserves hard links in the destination. Maintains storage optimization but requires hard link support on destination file system.
Choose the appropriate method based on destination file system capabilities and storage requirements.
Disabling Config Hard Link
Section titled “Disabling Config Hard Link”To disable hard link creation:
- Edit
.env
file:
HARD_LINK=false
- Restart rConfig services:
systemctl restart php-fpmsystemctl restart nginx # or httpd
Effect: Future backups create physical file copies instead of hard links. Existing hard links remain but won’t be removed—they continue functioning normally until individual versions are purged per retention policies.
Troubleshooting
Section titled “Troubleshooting”Hard Links Not Creating
Section titled “Hard Links Not Creating”Symptom: HARD_LINK=true but new backups create physical copies instead of hard links.
Possible causes:
- File system doesn’t support hard links
- Configuration changes between backups (hashes differ)
- Files on different file systems/partitions
- Insufficient permissions
Resolution:
- Verify file system supports hard links:
df -T /storage/app/rconfig
- Confirm configurations are actually identical (compare file hashes)
- Ensure rConfig storage is on a single file system
- Check www-data user has appropriate permissions
Storage Not Decreasing
Section titled “Storage Not Decreasing”Symptom: Enabled hard links but storage usage unchanged.
Possible causes:
- Configurations are changing frequently (no identical backups to link)
- Retention already purged old duplicates before hard links enabled
- Monitoring tool doesn’t account for hard links correctly
Resolution:
- Review configuration change frequency in device history
- Allow several backup cycles for savings to accumulate
- Use
du -h --apparent-size
vsdu -h
to understand actual vs. apparent storage
Link Icon Not Appearing
Section titled “Link Icon Not Appearing”Symptom: Hard links created but indicator missing in UI.
Possible causes:
- Browser cache showing old interface
- UI needs refresh after enabling feature
Resolution:
- Clear browser cache and refresh
- Verify HARD_LINK=true in .env
- Check application logs for errors
Best Practices
Section titled “Best Practices”Enable for Stable Infrastructure
Section titled “Enable for Stable Infrastructure”Hard links provide maximum value for devices with stable configurations. Enable the feature for edge networks, access layers, and standardized infrastructure where configurations change infrequently.
Monitor Storage Savings
Section titled “Monitor Storage Savings”Track storage consumption before and after enabling hard links to quantify savings:
# Before enablingdu -sh /storage/app/rconfig/data/
# After 30 days with hard links enableddu -sh /storage/app/rconfig/data/
Combine with Retention Policies
Section titled “Combine with Retention Policies”Hard links reduce storage for unchanged configurations, but retention policies still govern how long versions are kept. Combine hard links with appropriate retention settings for optimal storage management.
Document for Team
Section titled “Document for Team”Ensure operations teams understand hard links are in use, particularly for:
- Backup and restore procedures
- Storage capacity planning
- Server migration operations
Related Documentation
Section titled “Related Documentation”- Configuration Backup Implementation - Understanding backup operations
- Configuration Diffs - How diffs work with hard-linked files
- Storage and Retention Policies - Managing long-term configuration storage
Quick Reference
Section titled “Quick Reference”Enable Hard Links
Section titled “Enable Hard Links”# Edit .env filenano /var/www/html/rconfig8/current/.env
# Add or modifyHARD_LINK=true
# Restart servicessystemctl restart php-fpm nginx
Verify Hard Links
Section titled “Verify Hard Links”# Check link countls -l /storage/app/rconfig/data/[path]/config.txt
# Link count > 1 indicates hard links in use
Visual Indicator
Section titled “Visual Indicator”Look for 🔗 icon in rConfig UI next to hard-linked configurations
Storage Comparison
Section titled “Storage Comparison”# Apparent size (what hard links show)du -h --apparent-size /storage/app/rconfig/data/
# Actual disk usage (what's physically stored)du -h /storage/app/rconfig/data/