Bump ramdisk to 10G; add ramdisk_stop.sh; fix info→log typo in common.sh

host1.conf: HOST1_RAMDISK_SIZE 8G→10G, WARN_GB 6.8→8.5, LOW_GB 5.5→7.
ramdisk_stop.sh: new Tools/ script — redirects symlink to SSD before unmount
  so Emby keeps writing during maintenance, auto-falls back to lazy umount
  when only directory handles are open (no active writes).
common.sh: fix `info` call at line 595 (undefined) → `log`.
Tools docs: added ramdisk_stop.sh to README table, categories, diagram, and Manual.
This commit is contained in:
Gmer4Lfe
2026-05-22 17:35:16 -04:00
parent 8a3e22c9b8
commit 16e3b7651d
5 changed files with 416 additions and 7 deletions
+68
View File
@@ -20,6 +20,7 @@ making any changes.
- [recreate_shares.sh](#recreate_sharessh)
- [continuous_scripts_status.sh](#continuous_scripts_statussh)
- [claude_startup.sh](#claude_startupsh)
- [ramdisk_stop.sh](#ramdisk_stopsh)
- [Adding a New Tool](#adding-a-new-tool)
---
@@ -631,6 +632,73 @@ claude_startup.sh --setup # set up symlinks only — no launch (for array_star
---
## ramdisk_stop.sh
Safely stops the transcode ramdisk: redirects the transcode symlink to the SSD
fallback first (so Emby continues writing without interruption), then unmounts the
tmpfs and updates the state file. Primary use case is stopping the current ramdisk
before re-running `ramdisk_setup.sh` with new size or threshold values.
### When to Use
```
Bumping RAMDISK_SIZE — setup script is idempotent, skips remount if already mounted
→ stop first, then re-run ramdisk_setup.sh with new HOST*_RAMDISK_SIZE value
Adjusting RAMDISK_WARN_GB / RAMDISK_LOW_GB thresholds
→ no need to stop for threshold changes (transcode_manager reads vars live)
→ only needed if you're also changing the size
Temporarily freeing ramdisk RAM — reclaim tmpfs back to general memory pool
→ stop, restart later with ramdisk_setup.sh
```
### Stop Sequence
```
1. Redirect symlink: TRANSCODE_LINK → TRANSCODE_SSD
Emby immediately writes to SSD — no broken-path window during unmount
2. Check for active transcode files on ramdisk (warn, don't block)
Files in progress on the ramdisk are lost on unmount — expected for maintenance
3. Unmount ramdisk
Regular umount first; if busy (directory handles only, no active writes)
falls back to lazy unmount automatically
4. Update /tmp/transcode_state.db → current_target=TRANSCODE_SSD
transcode_manager.sh reads this on its next cycle
```
### transcode_manager Warning
If `transcode_manager.sh` is running, it may flip the symlink back to the ramdisk
on its next cycle (once the ramdisk is unmounted, that flip will fail). Stop
`transcode_manager.sh` first if you need the SSD redirect to hold before remounting.
### After Stopping
```bash
# Update host*.conf with new size values:
# HOST1_RAMDISK_SIZE="10G"
# HOST1_RAMDISK_WARN_GB=8.5
# HOST1_RAMDISK_LOW_GB=7
# Remount at new size:
bash Transcodes/ramdisk_setup.sh
```
### Usage
```bash
ramdisk_stop.sh --status # show mount state, symlink, active files — always check first
ramdisk_stop.sh --dry-run # show what would happen without making changes
ramdisk_stop.sh # stop the ramdisk
ramdisk_stop.sh --log # verbose — show each step
```
---
## Adding a New Tool
Write the tool when you solve a problem manually with bash commands. You'll face it again.