claude-home/reference/networking/nas-mount-configuration.md
Cal Corum 715354da7d CLAUDE: Add comprehensive documentation for Tdarr monitoring and NAS configuration
Complete documentation package for home lab infrastructure:

## New Documentation Files:
- **Tdarr Monitoring Configuration**: Complete setup guide for Discord-based Tdarr monitoring system
- **NAS Mount Configuration**: SMB/CIFS mount setup and troubleshooting for media storage
- **Discord Monitoring Setup**: Step-by-step guide for webhook configuration and notification testing

## Documentation Features:
- **Reference Architecture**: Best practices for distributed Tdarr deployments
- **Configuration Templates**: Copy-paste ready configurations with security considerations
- **Troubleshooting Guides**: Common issues and solutions for production environments
- **Integration Examples**: Real-world implementation patterns for home lab environments

## Coverage Areas:
- Docker container orchestration and monitoring
- Network storage integration and performance optimization
- Automated alerting and notification systems
- Production-ready configuration management

These documents support the enhanced monitoring system and provide comprehensive guidance for maintaining a robust home lab infrastructure.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-10 10:39:55 -05:00

205 lines
6.2 KiB
Markdown

# NAS Mount Configuration - TrueNAS SMB Optimization
## Overview
This document contains the optimized SMB mount configurations for TrueNAS (10.10.0.35) across multiple systems in the homelab. These optimizations provide significant performance improvements over default SMB settings.
## TrueNAS System Details
- **IP Address**: 10.10.0.35
- **System**: TrueNAS Server
- **SMB Version**: 3.1.1 (optimized from 3.0)
- **Available Shares**: `/media` and `/cals-files`
## Performance Results
### Before Optimization
- **Tdarr Server**: 61.8 MB/s
- **Local Workstation**: 11.1 MB/s
### After Optimization
- **Tdarr Server**: 103 MB/s (67% improvement)
- **Local Workstation**: 85.4 MB/s (669% improvement)
## Optimized Mount Configurations
### Tdarr Server (ubuntu-ct - 10.10.0.43)
**File**: `/etc/fstab`
```bash
//10.10.0.35/media /mnt/truenas-share cifs vers=3.1.1,cache=loose,credentials=/root/.truenascreds,rsize=16777216,wsize=16777216,bsize=4194304,actimeo=30,closetimeo=5,echo_interval=30
```
**Active Mount Options** (negotiated):
```
vers=3.1.1,cache=loose,rsize=8388608,wsize=8388608,bsize=4194304,
actimeo=30,closetimeo=5,echo_interval=30
```
### Local Workstation (nobara-pc)
**File**: `/etc/fstab`
```bash
//10.10.0.35/media /mnt/media cifs credentials=/home/cal/.samba_credentials,uid=1000,gid=1000,vers=3.1.1,cache=loose,rsize=16777216,wsize=16777216,bsize=4194304,actimeo=30,closetimeo=5,echo_interval=30,noperm 0 0
//10.10.0.35/cals-files /mnt/cals-files cifs credentials=/home/cal/.samba_credentials,uid=1000,gid=1000,vers=3.1.1,cache=loose,rsize=16777216,wsize=16777216,bsize=4194304,actimeo=30,closetimeo=5,echo_interval=30,noperm 0 0
```
**Active Mount Options** (negotiated):
```
vers=3.1.1,cache=loose,rsize=8388608,wsize=8388608,bsize=4194304,
actimeo=30,closetimeo=5,echo_interval=30,noperm
```
## Key Optimization Parameters
### Protocol Version
- **Setting**: `vers=3.1.1`
- **Previous**: `vers=3.0`
- **Benefit**: Latest SMB protocol with performance improvements and better security
### Cache Strategy
- **Setting**: `cache=loose`
- **Previous**: `cache=strict`
- **Benefit**: Better read performance, less strict consistency requirements
### Buffer Sizes
- **Read Size**: `rsize=16777216` (requested) → `rsize=8388608` (negotiated)
- **Write Size**: `wsize=16777216` (requested) → `wsize=8388608` (negotiated)
- **Block Size**: `bsize=4194304` (4MB, up from 1MB)
- **Previous**: `rsize=4194304,wsize=4194304,bsize=1048576`
- **Benefit**: Larger buffers reduce network round trips
### Connection Timeouts
- **Attribute Cache**: `actimeo=30` (30 seconds, up from 1 second)
- **Close Timeout**: `closetimeo=5` (5 seconds, up from 1 second)
- **Echo Interval**: `echo_interval=30` (30 seconds, down from 60 seconds)
- **Benefit**: Better connection persistence, fewer reconnections
## Credential Files
### Tdarr Server
**File**: `/root/.truenascreds`
```
username=plex
password=[password]
domain=
```
### Local Workstation
**File**: `/home/cal/.samba_credentials`
```
username=plex
password=[password]
domain=
```
**Security**: Both files should be owned by root with 600 permissions:
```bash
sudo chown root:root /path/to/credentials
sudo chmod 600 /path/to/credentials
```
## Mount Commands
### Apply New Configuration
```bash
# Unmount existing mounts
sudo umount /mnt/media
sudo umount /mnt/cals-files
# Mount with new optimized settings
sudo mount /mnt/media
sudo mount /mnt/cals-files
```
### Verify Mount Options
```bash
mount | grep -E 'media|cals-files'
```
### Test Performance
```bash
# Test read performance (100MB test)
time dd if="/mnt/media/path/to/large/file.mkv" bs=1M count=100 of=/dev/null
```
## Troubleshooting
### Common Issues
**Mount Error: Device or resource busy**
- Solution: Unmount existing mount first: `sudo umount /mnt/media`
**Parse Error in fstab**
- Check for missing `//` before IP address
- Ensure no spaces in comma-separated options
- Verify all commas are present between options
**Permission Denied**
- Verify credential file exists and has correct permissions (600)
- Check username/password in credential file
- Ensure TrueNAS user has access to the share
**Slow Performance After Changes**
- Verify new mount options are active: `mount | grep media`
- Test with different file sizes to confirm improvement
- Check network connectivity: `ping 10.10.0.35`
### Performance Testing Commands
```bash
# Quick performance test (50MB)
time dd if="/mnt/media/Movies/[movie-file]" bs=1M count=50 of=/dev/null
# Larger performance test (100MB)
time dd if="/mnt/media/Movies/[movie-file]" bs=1M count=100 of=/dev/null
# Monitor network during transfer
iftop -i eth0
```
## Backup and Rollback
### Before Making Changes
```bash
# Backup fstab
sudo cp /etc/fstab /etc/fstab.backup-$(date +%Y%m%d-%H%M%S)
```
### Rollback if Needed
```bash
# Restore from backup
sudo cp /etc/fstab.backup-YYYYMMDD-HHMMSS /etc/fstab
# Remount
sudo umount /mnt/media
sudo mount /mnt/media
```
## System-Specific Notes
### Tdarr Integration
- **Unmapped Node Architecture**: Node downloads files from Tdarr server at optimized 103 MB/s
- **Cache Directory**: Uses local NVMe storage for maximum transcoding performance
- **No Direct NAS Access**: Unmapped nodes don't directly access NAS mounts
### Local Workstation Usage
- **Media Browsing**: 85.4 MB/s for fast local media access
- **File Management**: Significantly faster file operations
- **Backup Operations**: Improved speeds for large file transfers
## Future Expansion
When adding new systems, use these optimized settings as the baseline:
```bash
//10.10.0.35/media /mnt/media cifs credentials=/path/to/creds,uid=1000,gid=1000,vers=3.1.1,cache=loose,rsize=16777216,wsize=16777216,bsize=4194304,actimeo=30,closetimeo=5,echo_interval=30,noperm 0 0
```
Adjust `uid`, `gid`, and credential path as needed for each system.
## Related Documentation
- [SSH Key Management](ssh-key-management.md) - For secure access to systems
- [Tdarr Troubleshooting](../docker/tdarr-troubleshooting.md) - For Tdarr-specific issues
- [Network Troubleshooting](ssh-troubleshooting.md) - For general network issues
---
*Last updated: August 10, 2025*
*Performance improvements: Tdarr Server 67% faster, Local Workstation 669% faster*