Guard status writes until Unraid user shares are mounted
Problem
Borg Backup UI can start before Unraid has mounted the storage selected for its primary data directory. This is commonly /mnt/user, but it can also be a pool, array disk, Unassigned Devices path, or another concrete mount below /mnt.
Status, restore-test, and snapshot writers currently use recursive directory creation. If the expected mount is unavailable, they could create the configured path on the root filesystem and later lose or hide status data when the real mount appears.
The startup log also does not identify the running Borg Backup UI version, which makes update and restart diagnostics harder.
Expected behavior
- Read GLOBAL_DATA_DIR and its derived runtime paths before normal services start.
- Determine the actual backing mount for configured paths such as /mnt/user, /mnt/cache, /mnt/disk1, /mnt/disks/
, and /mnt/remotes/ . - Wait for required mounts before startup migrations and runtime services use those paths.
- Log the wait, configured data directory, required mount, elapsed time, success, and timeout in the same style as the Python runtime wait.
- Do not start Scheduler, status workers, or the web server after the storage wait times out.
- Never create or write backup status, restore-test status, or related snapshot files below an unavailable /mnt mount, even outside startup.
- Status reads return an empty result while storage is unavailable and emit one clear diagnostic per process and path.
- Log the Borg Backup UI application version on every application start.
- Cover mount detection, waiting, timeout, guarded writes, unavailable reads, and the startup version log with focused tests.
User impact
Prevents runtime and status files from being written to the wrong filesystem during early boot or a missing-storage condition. Startup and update logs also show exactly what Borg Backup UI is waiting for and which version is running.