BalenaSound and Transmission

Hi,
I used Balena Sound for a month now, and wanted to add more “features” to the Raspberry Pi I use to run it. An important feature I’m trying to add is the support of Transmission.

I tried to figure out how to do it, but I’m not sure how to do it working, since I wasn’t able to run the

apt-get update | apt-get upgrade

commands, that I usually use.

Do you know how I can proceed?
Thanks for your help

Michael

Hi, there’s a docker image for transmission, see docs: https://github.com/linuxserver/docker-transmission#docker-compose
You can add transmission docker-compose service config to existing balena sound docker-compose.yml.

Hi,
I know that I’m a beginner, :expressionless: and I didn’t achieve what you said (if I understood well). So I have uninstalled the BalenaSound features in order to push the whole package at a single time.

So I downloaded the docker image you mentionned and placed it at the same level as the three other services (then I have the folders : airplay, bluetooth-audio, docker-transmission-master, spotify. At this level I also have the docker-compose.yml and few others file).

As you mentionned, I have added the config of transmission into my docker-compose.yml in the following way:

version: ‘2’
services:
bluetooth-audio:
network_mode: host
restart: always
build: ./bluetooth-audio
privileged: true
labels:
io.balena.features.dbus: 1
io.balena.features.supervisor-api: 1
airplay:
build: ./airplay
restart: always
network_mode: host
privileged: true
labels:
io.balena.features.dbus: 1
spotify:
build: ./spotify
restart: always
network_mode: host
privileged: true
labels:
io.balena.features.dbus: 1
transmission:
image: ./linuxserver/transmission
container_name: transmission
environment:
- PUID=0
volumes:
- /mnt/MICHAEL/Torrent/config:/config
- /mnt/MICHAEL/Torrent/Completed:/downloads
- /mnt/MICHAEL/Torrent/Watch:/watch
ports:
- 9091:9091
- 51413:51413
- 51413:51413/udp
restart: unless-stopped

But I have this error when I try to push it to the RaspberryPi:

[Error] Could not parse compose file
[debug] handling message: {“message”:“\u001b[31m[Error]\u001b[39m Bind mounts are not allowed”,“isError”:true}
[Error] Bind mounts are not allowed

Do you know what I did wrong :?

Many thanks for your help, and sorry for my english :wink:

Michael

PS: Sorry but I didn’t achieved to indent this post…

Hey @mg.greub@icloud.com,

The balena docs mention certain bind mount restrictions [1], linking to another doc [2] where certain container labels are able to toggle some specific bind mounts enumated in a table. If you want a bind-mount into the host OS fs other than that, it’s not possible, as yet.

One way to work around the lack of arbitrary bind mounts is to re-evaluate whether a bind mount is needed; sometimes a named volume, which can be shared among the other running containers [3], is good enough.

[1] https://www.balena.io/docs/reference/supervisor/docker-compose/ (see “Supported fields” > “volumes”)
[2] https://www.balena.io/docs/reference/supervisor/docker-compose/#labels
[3] https://www.balena.io/docs/learn/develop/multicontainer/#named-volumes

There’s a related PR you can follow here: https://github.com/balena-io/balena-supervisor/issues/643

Hi,
first of all, thanks for your help.
I finally achieved to run all this stuff, but still get a problem. When I mount my external drive (2TB), I can not achieve to use it in this context.
I tried this first method : https://www.balena.io/docs/learn/develop/runtime/#mounting-external-storage-media, but I can’t use it, or I don’t know how to use it.

Here is my docker-compose.yml configuration:

version: ‘2’
services:
bluetooth-audio:
network_mode: host
restart: always
build: ./bluetooth-audio
privileged: true
labels:
io.balena.features.dbus: 1
io.balena.features.supervisor-api: 1
airplay:
build: ./airplay
restart: always
network_mode: host
privileged: true
labels:
io.balena.features.dbus: 1
spotify:
build: ./spotify
restart: always
network_mode: host
privileged: true
labels:
io.balena.features.dbus: 1
transmission:
build: ./docker-transmission-master
environment:
- PUID=1001
volumes:
- ‘MICHAEL:/Torrent/config’
- ‘MICHAEL:/Torrent/downloads’
- ‘MICHAEL:/Torrent/watch’
ports:
- 9091:9091
- 51413:51413
- 51413:51413/udp
restart: unless-stopped
volumes:
MICHAEL:

Did you see a big mistake here??
Whatever, all 4 services are running and working.

A last question, is also balena-sound compatible with docker system on raspbian lite for example?

Thanks for your precious help and sorry for my english

Michael

Hi Michael, I don’t see anything immediately obvious with the compose file you have provided. What issues are you seeing when you mount the external drive which is preventing you from using it? Are there are errors or logs produced? Thanks.

Hello.

Unfortunately I do not have any error.
The volume seems to mount (I have a "xxxxxx_MICHAEL volume in the volume list), but not to be connected with the external Hard Drive.
One of the problem, is when transmission tries to import bigger files, I have a “no more space” error.
Therefore I suspect two problems:

  • The HDD is correctly mount but I fail to access it or
  • The volume that is created is not linked to the HDD

Here is the procedure of how I mount my HDD, to the docker file of transmission I have added the following line:

RUN echo "LABEL=mysdcard /mnt/storage ext4 rw,relatime,discard,data=ordered 0 2" >> /etc/fstab

And I have created also in the transmission folder, a start.sh file with the following line:
mkdir -p /mnt/storage && mount /mnt/storage

Any clue??
Still many thanks for your help

Michael

Hi there,

So first of all, I want to clarify that it’s not possible to associate an engine volume you define in docker-compose with an external drive. It’s a feature in the engine that we want to implement in the future, but it’s not possible at the moment.

However, what you can do is mounting an external drive in a single privileged container.
And this is what is described in our docs. We’ll need to double-check if the information there is still actual but if it does not work for you(please let us know), what I would recommend is to follow the next steps (we tested this sequence today):

  • ssh into the container
  • make sure you see the disk device in /dev directory (something like /dev/sda1)
  • run mkdir /mnt/storage
  • run mount -t ext4 -o rw /dev/sda1 /mnt/storage (changing the file system type and device path as needed)

You should be able to see the content of the drive in /mnt/storage. If that works, doing the same steps in your container entry point should also work.
Hope it’s helpful.

Hey,

I tried what you said, but I had a problem. Don’t know if it’s normal, but I can’t access the /dev/sda1, I can only see it.
The mount command gives me an no such device error.
The disk is correctly plugged and working (on other devices).
I tried by both way the ssh in BalenaCloud dashboard and the ssh via the CLI.

Thanks for your help

Hi, can you post the output of lsblk from the host OS to confirm the location of the external drive?

Hi, here its is:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 1.8T 0 disk
'-sda1 8:1 0 1.8T 0 part
mmcblk0 179:0 0 14.9G 0 disk
|-mmcblk0p1 179:1 0 40M 0 part /mnt/boot
|-mmcblk0p2 179:2 0 312M 0 part /mnt/sysroot/active
|-mmcblk0p3 179:3 0 312M 0 part
|-mmcblk0p4 179:4 0 1K 0 part
|-mmcblk0p5 179:5 0 20M 0 part /mnt/state
'-mmcblk0p6 179:6 0 14.2G 0 part /mnt/data

Thanks for your help

Thanks, that looks good. Can you provide the exact commands you are using to create the mount point and mount the device? Also, can you confirm the filesystem type of the device from lsblk -f. Also, are you trying to mount this from the host OS or from a container?

Thanks for your help.

  1. I use these commands in the BalenaCloud, Transmission SSH.

mkdir /mnt/storage

mount -t ntfs -o rw /dev/sda1 /mnt/storage

  1. Here is the result of lsblk -f:

NAME FSTYPE LABEL UUID MOUNTPOINT
sda
`-sda1 ntfs MICHAEL D4FECAC9FECAA2DA

  1. I tried both (still using web interface), but from the host I have an Read-only file system error, and from transmission container I have an no such device error.

Thanks, to simplify this, can you temporarily try to create a mount point in /tmp and then try to mount there from the host OS?

HI,

I just did it and I have the same no such device error on the container terminal, but I get an unknown filesystem type 'ntfs' when I try to mount with the OS terminal…

In balenaOS we don’t have NTFS support baked in. Could you try with some other filesystem like ext4?