September 30, 20169 yr Hello folks, So I have been running Unraid and Docker for donkies without issue. The other day I had to power my server down for some electrical work to be done on the house, work was completed, server rebooted all sorted.. Or so I thought. I went to watch plex later in the evening, and noticed the dashboard hadn't updated with the new films I'd added. hmm so I ran a full refresh on movies and decided to watch a TV program but I got media unavailable. checked and checked in plex and on the server, but everything seemed fine so I thought ok I'll blow away the plex container and recreate it.. Went to re-add the libs but the content was empty, I have tried this several times now. eventually I hopped onto the container to see what was going on. # docker exec -u 0 -it PlexMediaServer bash root@NAS-server:/config# df -k Filesystem 1K-blocks Used Available Use% Mounted on /dev/loop0 20971520 15277472 3297120 83% / tmpfs 8091416 0 8091416 0% /dev shm 65536 4 65532 1% /dev/shm /dev/loop0 20971520 15277472 3297120 83% /data rootfs 8032744 313124 7719620 4% /Films /dev/sdj 1562813784 193753556 1367491532 13% /config rootfs 8032744 313124 7719620 4% /TV ok so the Directories are there. Basically mapping /mnt/user/TV to /TV and /mnt/user/Films to /Films root@NAS-server:/mnt/TV# pwd /mnt/TV root@NAS-server:/mnt/TV# ls so nothing in the Directory, to make sure I wasn't going mad I did an ls on the underlaying host :- root@NAS-server:/boot/config# cd /mnt/user root@NAS-server:/mnt/user# ls Films/ Macbckup/ TV/ btrfs@ test/ root@NAS-server:/mnt/user# cd TV root@NAS-server:/mnt/user/TV# ls 12\ Monkeys/ Generation\ Kill/ Silicon\ Valley/ Agent\ X/ Hand\ of\ God/ files are there. So I hopped back onto the container again. went to /config root@NAS-server:/Films# cd /config root@NAS-server:/config# ls Library tmp So that directory appears to have mapped ok. Permissions all look good I am at a complete loss any one have any ideas for me at all please. Thanks
September 30, 20169 yr Question: On your configs, where are you getting /mnt/btrfs/... from? Unless you're mounting that manually, or set it up with an old version of unassigned devices, that mount point doesn't exist, and will wind up being stored in RAM. Should be something like /mnt/user/docker/... under normal circumstances
September 30, 20169 yr Hi yeah, Its a mounted 1.6TB SSD OK. In that case, under any version of unRaid, you have to stop and restart the ENTIRE docker service via settings - docker on any boot / reboot as it will not properly recognize the /config folder since its not local to the array. (If it was mounted in /mnt/disks, then you could use one of the "slave" modes to accomplish this instead)
September 30, 20169 yr Author The config directory is fine.. its the films and tv I can't see. I stop and restart docker at boot time vi the go file, I do sme tweaking to push sickrage and transmission out my vpn network, dual hosted unraid.. anyway I digress. So it gets stranger, sickrage is the same too, under /media to tv programs. /mnt/user/TV it too was empty, so I changed it to /mnt [root@8beee782d872 user]# cd /media [root@8beee782d872 media]# ls btrfs cache disk1 disk2 disk3 disk4 disk5 disk6 disks user user0 all good [root@8beee782d872 media]# cd user [root@8beee782d872 user]# ls -l total 0 drwxr-xr-x 3 root root 60 Sep 30 12:03 appdata drwxr-xr-x 2 root root 40 Sep 30 12:03 Films drwxr-xr-x 2 root root 40 Sep 30 12:03 TV There are directories missing :- on the underlying server :- drwxrwxrwx 1 nobody users 31 Nov 24 2015 Downloads/ drwxrwxrwx 1 nobody users 4096 Sep 29 19:33 Films/ drwxrwxrwx 1 nobody users 79 Oct 7 2015 Macbckup/ drwxrwxrwx 1 nobody users 71 Feb 17 2015 PVR/ drwxrwxrwx 1 nobody users 4096 Sep 28 10:48 TV/ drwxrwxrwx 1 nobody users 6 Feb 4 2016 backup/ lrwxrwxrwx 1 root root 10 Nov 12 2014 btrfs -> /mnt/btrfs/ drwxrwxrwx 1 nobody users 6 Oct 20 2015 test/ under films in container [root@8beee782d872 user]# cd Films [root@8beee782d872 Films]# ls [root@8beee782d872 Films]# So it's got to be something with perms or something but I'm stuffed if I can figure out what
September 30, 20169 yr Author This just keeps getting odder in container :- [root@8beee782d872 user]# mkdir fred [root@8beee782d872 user]# ls appdata Films fred TV [root@8beee782d872 user]# look on underlying server fs, not there. root@NAS-server:/mnt/user# ls Downloads/ Films/ Macbckup/ PVR/ TV/ backup/ btrfs@ test/ root@NAS-server:/mnt/user#
October 1, 20169 yr I don't believe you should be creating folders under /mnt/user, as it is a virtual file system, constructed from the real file systems on the drives, array drives or the cache drive or pool. What you want to do is create fred on the disk you want it, such as the Cache disk, then it will automatically appear in /mnt/user. Or create the User Share in the User Share settings, specifying the Included disks. When you create a folder in /mnt/user, it has no idea where the physical storage will be yet.
October 1, 20169 yr I believe the original problem all revolves around the fact that you are starting the dockers in your go file rather than letting Unraid start them on array startup. The problem is that the mapping to directories on the base Unraid system to docker is done when the docker starts. When the array is subsequently started a new version of the directory is mounter over the one already used by the docker .... So you now have 2 versions of the directory with the same apparent name depending whether you view it via the docker or base Unraid system.
October 1, 20169 yr I believe the original problem all revolves around the fact that you are starting the dockers in your go file rather than letting Unraid start them on array startup. The problem is that the mapping to directories on the base Unraid system to docker is done when the docker starts. When the array is subsequently started a new version of the directory is mounter over the one already used by the docker .... So you now have 2 versions of the directory with the same apparent name depending whether you view it via the docker or base Unraid system. Good catch. Didn't see that little comment. But, on re-reading the post where he mentions stops / starts of docker via go, I believe what he's trying to do is work around docker not recognizing mounts other than /mnt/user without a restart of the service. Should work, but is dependent upon appropriate sleep commands to get the timing correct, because if the timing is off, then I can see what you're describing as an outcome. The absolute best solution for this is an upgrade to 6.2, reorganize the external mount to be under /mnt/disks, and use the slave mode to mount the appropriate shares so that the work-around (and timing issue) doesn't come into play. And my suggestion to manually stop / restart the entire service to see what happens still stands...
October 1, 20169 yr Author Problem sorted. Deleted the Docker image and restarted docker re-added the containers problem gone.. very strange issue. As for the comment about me not letting docker get started by the array, I do like it get started, then stop it, make some changes then restart Ie :- echo "1" mkdir -p /mnt/btrfs echo "2" btrfs device scan mount -t btrfs /dev/sdj /mnt/btrfs /etc/rc.d/rc.docker stop sleep 20 ifconfig eth1 plumb ifconfig eth1 up brctl addbr br1 brctl addif br1 eth1 ifconfig br1 inet 192.168.2.100 netmask 255.255.255.0 broadcast 192.168.2.255 up /etc/rc.d/rc.docker start echo "lets set our container routes" sleep 60 #get the container id of transmission and Rage Transid=`docker ps | grep transmission | cut -b 1-12` RAGEid=`docker ps | grep rage| cut -b 1-12` #now find the process id for the container. TransProcID=`docker inspect -f '{{.State.Pid}}' $Transid` RAGEProcID=`docker inspect -f '{{.State.Pid}}' $RAGEid` #create the links to allow us to use netns to change variables within the container. mkdir -p /var/run/netns ln -s /proc/$TransProcID/ns/net /var/run/netns/$TransProcID ln -s /proc/$RAGEProcID/ns/net /var/run/netns/$RAGEProcID # use netns to change the default root to use the vpn connection. ip netns exec $TransProcID route del default gw 192.168.2.100 ip netns exec $TransProcID ifconfig eth0 down ip netns exec $TransProcID ifconfig eth0 inet 192.168.2.10 ip netns exec $TransProcID route add default gw 192.168.2.1 ip netns exec $TransProcID ifconfig eth0 up ip netns exec $RAGEProcID route del default gw 192.168.2.100 ip netns exec $RAGEProcID ifconfig eth0 down ip netns exec $RAGEProcID ifconfig eth0 inet 192.168.2.20 ip netns exec $RAGEProcID route add default gw 192.168.2.1 ip netns exec $RAGEProcID ifconfig eth0 up # Start the Management Utility /usr/local/sbin/emhttp -p 9090 & ~ I'm sure there is a cleaner way of doing things, but this just allows me to push those containers down my external VPN. Cheers
October 1, 20169 yr Community Expert Problem sorted. Deleted the Docker image and restarted docker re-added the containers problem gone.. very strange issue. As for the comment about me not letting docker get started by the array, I do like it get started, then stop it, make some changes then restart Ie :- echo "1" mkdir -p /mnt/btrfs echo "2" btrfs device scan mount -t btrfs /dev/sdj /mnt/btrfs /etc/rc.d/rc.docker stop sleep 20 ifconfig eth1 plumb ifconfig eth1 up brctl addbr br1 brctl addif br1 eth1 ifconfig br1 inet 192.168.2.100 netmask 255.255.255.0 broadcast 192.168.2.255 up /etc/rc.d/rc.docker start echo "lets set our container routes" sleep 60 #get the container id of transmission and Rage Transid=`docker ps | grep transmission | cut -b 1-12` RAGEid=`docker ps | grep rage| cut -b 1-12` #now find the process id for the container. TransProcID=`docker inspect -f '{{.State.Pid}}' $Transid` RAGEProcID=`docker inspect -f '{{.State.Pid}}' $RAGEid` #create the links to allow us to use netns to change variables within the container. mkdir -p /var/run/netns ln -s /proc/$TransProcID/ns/net /var/run/netns/$TransProcID ln -s /proc/$RAGEProcID/ns/net /var/run/netns/$RAGEProcID # use netns to change the default root to use the vpn connection. ip netns exec $TransProcID route del default gw 192.168.2.100 ip netns exec $TransProcID ifconfig eth0 down ip netns exec $TransProcID ifconfig eth0 inet 192.168.2.10 ip netns exec $TransProcID route add default gw 192.168.2.1 ip netns exec $TransProcID ifconfig eth0 up ip netns exec $RAGEProcID route del default gw 192.168.2.100 ip netns exec $RAGEProcID ifconfig eth0 down ip netns exec $RAGEProcID ifconfig eth0 inet 192.168.2.20 ip netns exec $RAGEProcID route add default gw 192.168.2.1 ip netns exec $RAGEProcID ifconfig eth0 up # Start the Management Utility /usr/local/sbin/emhttp -p 9090 & ~ I'm sure there is a cleaner way of doing things, but this just allows me to push those containers down my external VPN. Cheers There is no guarantee that sdj will always be the device you expect it to be.
October 1, 20169 yr Author Possibly not, but it's worked for the last 3+ years so if it changes I'll deal with it. Cheers Steve
Archived
This topic is now archived and is closed to further replies.