2

My setup is the following:

Physical host with QEMU/KVM -> VM with Docker -> rtorrent Docker container

I have a ZFS pool called "main" with a dataset called "data". The "data" dataset is mounted on the VM via the virtio kernel module as suggested via this link. From here, my rtorrent Docker container has its download volume mapped to the mounted dataset on the VM:

$ docker run -dt --name rtorrent-rutorrent --network=host -p 8080:80 -p 49160:49160/udp -p 49161:49161 -v /data/rtorrent:/downloads -e "NOIPV6=1" diameter/rtorrent-rutorrent:latest

Here's where I'm confused: when I'm attached to the container, I can write to the dataset via touch, wget without issues. When I add a torrent to rtorrent however, nothing writes. It sits on "downloading" with no download speed. As soon as I change the container volume to point to the Docker VM local disk, everything works without issues.

I've done a couple of straces on the rtorrent process (link here) but there's not a whole lot that stands out to me here. Any input would be appreciated.

  • what are the owner, group, and permissions of /data/rtorrent? What uid and gid does the rtorrent client in the container run as? does that uid and/or gid have write access to that directory? (if not, it should). BTW, in case you haven't already done so, your torrent download dataset (main/data/rtorrent - which should be a separate dataset, not just a subdir of main/data) should have 16K recordsize. – cas Aug 4 '17 at 12:49
  • Owner and group are both "docker", folder is set to 777. UID and GID is 1000 via passthrough. – id0827502 Aug 4 '17 at 13:14
  • ok, so not perms then. what happens if you set up rtorrent to download to the VM's disk and then mv it to the main/data/rtorrent dataset? (i'm assuming rtorrent can auto-move a download after it has completed). test with a tiny torrent. – cas Aug 4 '17 at 13:29
2

This was resolved via the following: https://unix.stackexchange.com/a/212014/245005

In short, a flag needed to be added to the mount options for this to work - "cache=mmap". Now works without issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.