High-performance automated backup solution for Pi 5 NAS with SnapRAID protection, Google Drive integration, and intelligent storage management.
- Platform: Raspberry Pi 5 (8GB RAM)
- Storage Controller: Radaxa Penta HAT (5-bay SATA)
- Primary Storage: 4x 2TB SATA SSDs in SnapRAID array
- Boot Drive: NVMe SSD via USB 3.0 adapter
- Network: Gigabit Ethernet connection
βββ sda (2TB) β Data Drive 1 (Movies/TV Shows)
βββ sdb (2TB) β Data Drive 2 (Music/Audio)
βββ sdc (2TB) β Data Drive 3 (Photos/Documents) - **100% FULL in this example**
βββ sdd (2TB) β Data Drive 4 (General Storage) - **Used for backups (1.8T free)**
βββ sde (2TB) β Parity Drive (Protection)
π Note: In this configuration, sdc is 100% full, so the space management system automatically routes backups to sdd which has available space. Adapt drive assignments to match your actual hardware and usage patterns.
Total Capacity: 6TB usable + 2TB parity protection
### Mount Points
```bash
/srv/dev-disk-by-uuid-aaaaaaaa-bbbb-cccc-dddd-111111111111 # Movies
/srv/dev-disk-by-uuid-bbbbbbbb-cccc-dddd-eeee-222222222222 # Music
/srv/dev-disk-by-uuid-cccccccc-dddd-eeee-ffff-333333333333 # Photos
/srv/dev-disk-by-uuid-dddddddd-eeee-ffff-aaaa-444444444444 # Parity
- Local Redundancy: SnapRAID parity protection
- Cloud Backup: Google Drive sync via rclone
- System Backup: Configuration and Docker volumes
# Photo Collection Backup
Schedule: Daily at 4:00 AM
Bandwidth: 50 MB/s during off-peak
Method: Incremental sync with verification
# System Configuration Backup
Schedule: Daily at 4:30 AM
Bandwidth: 10 MB/s
Includes: OMV config, Docker volumes, system info
# SnapRAID Maintenance
Schedule: Weekly on Sunday 3:00 AM
Operation: Scrub 12% of array for integrity- Plex Media Server: Port 32400
- Immich Photo Management: Port 2283
- Portainer Management: Port 9000
- OpenMediaVault: Port 80
- SnapRAID: Automated parity and scrubbing
- rclone: Cloud backup synchronization
The system includes automated space management designed for multi-drive SnapRAID arrays:
Multi-Drive Intelligence:
- Handles 100% full drives (like sdc1 in your array)
- Routes backups to available drives automatically
- SnapRAID-aware space calculations
- Google Drive quota integration
Space Management Commands:
# Pre-backup space validation
/usr/local/bin/configured/raspberry-pi-nas-backup/scripts/backup/pi-nas-space-manager.sh check
# Smart cleanup of old logs and failed backups
/usr/local/bin/configured/raspberry-pi-nas-backup/scripts/backup/pi-nas-space-manager.sh cleanup
# Show comprehensive backup inventory
/usr/local/bin/configured/raspberry-pi-nas-backup/scripts/backup/pi-nas-space-manager.sh inventory
# Monitor Google Drive quota and usage
/usr/local/bin/configured/raspberry-pi-nas-backup/scripts/backup/pi-nas-space-manager.sh quotaPrevents backup failures even when individual drives are 100% full! π‘οΈ
# Automated cleanup policies
PHOTO_RETENTION_DAYS=365 # Keep photos 1 year locally
MEDIA_CACHE_SIZE=500GB # Plex transcode cache limit
LOG_RETENTION_DAYS=30 # System log retention
DOCKER_IMAGE_CLEANUP=weekly # Prune unused images
# Quota management
BACKUP_QUOTA_WARNING=80% # Warn at 80% cloud storage
DRIVE_SPACE_WARNING=85% # Warn at 85% drive usage- Network Tuning: Optimized TCP buffers for Gigabit
- Storage Tuning: noatime, optimized ext4 parameters
- Memory Management: Reduced swappiness, optimized cache
- Thermal Management: Active cooling with monitoring
- Physical: Secure location, controlled access
- Network: UFW firewall, SSH key authentication
- Storage: SnapRAID parity, encrypted cloud backup
- Access: Role-based permissions, audit logging
# SnapRAID recovery (single drive failure)
snapraid fix -d [failed_drive]
# Cloud restore (selective)
rclone copy gdrive:NAS_Backup/PhotoCollection /local/restore/
# System restore (complete)
./disaster-recovery.sh --full-restore- Sequential Read: 400-500 MB/s per drive
- Random I/O: 50,000-70,000 IOPS per drive
- Array Throughput: 1.2-1.5 GB/s aggregate
- Parity Calculation: 200-300 MB/s
- LAN Transfer: 900+ Mbps sustained
- Plex Streaming: 4K transcoding capable
- Backup Upload: 50-100 Mbps (configurable)
- Web Interface: Sub-second response times
# System health check
~/scripts/health_check.sh
# Backup status verification
~/scripts/backup_status.sh
# Network performance test
~/scripts/network_test.sh
# Temperature monitoring
vcgencmd measure_temp# SnapRAID status and scrub
snapraid status
snapraid scrub -p 12
# Docker cleanup
docker system prune -f
# Log rotation
sudo logrotate -f /etc/logrotate.conf- Drive Not Detected: Check SATA connections, power supply
- High Temperature: Verify cooling, check for dust buildup
- Network Issues: Test cable, check switch/router
- Backup Failures: Verify rclone config, check Google Drive quota
- Hardware Issues: Check hardware setup documentation
- Software Issues: Review installation and configuration guides
- Data Recovery: Follow disaster recovery procedures
- CPU temperature and throttling status
- Drive health and SMART data
- Network throughput and latency
- Backup success rates and timing
- Storage utilization and growth trends
- Power consumption and efficiency
- Storage Expansion: Additional drive bays available
- Network Upgrade: 2.5GbE or 10GbE capability
- Compute Upgrade: Future Pi models compatibility
- Software Stack: Container orchestration evolution
Last Updated: 2025-07-27 System Version: Pi 5 NAS v2.0
β β βββ NAS_Backup_Script.sh # Main backup automation β β βββ backup-script-final.sh # Enhanced backup script β βββ installation/ β βββ Raspberry_Pi_5_NAS_Automated_Installation_Script.sh β βββ Immich_Environment_Configuration.sh βββ docs/ β βββ hardware-setup-doc.md # Hardware assembly guide β βββ software-installation-doc.md # Software setup guide β βββ nvme-cloning-doc.md # NVMe setup and cloning β βββ Complete Pi 5 NAS Setup - README.md.pdf βββ docker/ βββ plex/ β βββ Plex_Docker_Compose_Configuration βββ immich/ β βββ Immich_Docker_Compose