Multiple Content Disks/Volumes in Docker Container (unionfs?)

Sonarr version (exact version): 3.0.6.1342-ls134 by linuxserver.io
Mono version (if Sonarr is not running on Windows): Docker Desktop on Windows 10
OS: Linux 730b9da8cd8a 5.10.16.3-microsoft-standard-WSL2 #1 SMP x86_64 x86_64 x86_64 GNU/Linux
Debug logs:
Description of issue: How to use multiple content Disks/Volumes within Docker Container?

I am running Sonarr on Windows Docker Desktop with WLS2 – Linux 5.10.xx.
My content library is distributed across multiple disks.
I’d like the library manager to see and update all content across all disks, but store new content in the last disk added where there is more than enough space.
I tried multiple setups to either mount them with rclone fs or a unionfs within another docker container and share it with the library manager, but that did not work properly.
I finally got something working by adding a startup.sh to the docker container that uses apt-get to install the required packages into the docker images and then defines and mounts the unionfs within the image using autofs.
So that works, and new content ends up on the right disk, according to the unionfs definition.
However, the status page in the library manager always says “Missing root folder: /tv/” or “Missing root folder: /movies/” respectively, even though the folders are there and writable.
See startup.sh below.

Does anyone have a better idea of how to do this?

(.i.e. maybe this can be achieved with multiple root folders? I found very little documentation on how to use multiple root folders).

Any help is appreciated.

#!/bin/bash
apt-get -y update
apt-get install -y systemd nfs-common netbase unionfs-fuse
service autofs stop
cp /config/auto.* /etc
[ ! -d "/nfs" ] && echo "Directory /nfs does not exist, making one" && mkdir /nfs
[ ! -d "/nfs/Elements" ] && echo "Directory /nfs/Elements does not exist, making one" && mkdir /nfs/Elements
[ ! -d "/nfs/Volume_Originals" ] && echo "Directory /nfs/Volume_Originals does not exist, making one" && mkdir /nfs/Volume_Originals
mount -t nfs -o rw,timeo=100,noatime,nolock 192.168.1.3:/nfs/Elements /nfs/Elements
mount -t nfs -o rw,timeo=100,noatime,nolock 192.168.1.3:/nfs/Volume_Originals /nfs/Volume_Originals
[ ! -d "/misc" ] && echo "Directory /misc does not exist, making one" && mkdir /misc
[ ! -d "/misc/Media_union" ] && echo "Directory /misc/Media_union does not exist, making one" && mkdir /misc/Media_union
unionfs -o cow,max_files=32768,use_ino,suid,dev,allow_other,hard_remove,nonempty,rw,noatime,uid=1000,gid=999 /nfs/Elements/Media/=RW:/nfs/Volume_Originals/Media/=RO /misc/Media_union
rpcbind
ls /nfs/Elements/Media/TV\ Shows | wc -l
ls /nfs/Volume_Originals/Media/TV\ Shows | wc -l
ls /misc/Media_union/TV\ Shows | wc -l
ln -s /misc/Media_union/TV\ Shows/ /tv
echo "startup.sh sonarr V5"
tail -f /dev/null
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc  /etc/auto.misc --timeout=0 --browse
#
# NOTE: mounts done from a hosts map will be mounted with the
#       "nosuid" and "nodev" options unless the "suid" and "dev"
#       options are explicitly given.
#
#/net   -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
/nfs/auto  /etc/auto.nfsdb --timeout=0 --browse
/misc   /etc/auto.misc --timeout=0 --browse
#
# auto.misc
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage

cd              -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom

# the following entries are samples to pique your imagination
#linux          -ro,soft,intr           ftp.example.org:/pub/linux
#boot           -fstype=ext2            :/dev/hda1
#floppy         -fstype=auto            :/dev/fd0
#floppy         -fstype=ext2            :/dev/fd0
#e2floppy       -fstype=ext2            :/dev/fd0
#jaz            -fstype=ext2            :/dev/sdc1
#removable      -fstype=ext2            :/dev/hdd

Media_union -fstype=fuse,cow,max_files=32768,use_ino,suid,dev,allow_other,hard_remove,nonempty,rw,noatime :unionfs\#/nfs/auto/Elements/Media/=RW:/nfs/auto/Volume_Originals/Media/=RO


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.