I’m trying to setup my first homeserver with pods alone but I can’t add my mounted /data (it’s an external HDD) folder to the root folder, but the /app and /config works. It’s a common issue but somehow I wasn’t able to solve it.

OS: Rocky Linux 9.3

External HDD (WD Elements)

external HDD in /etc/fstab:

# WD Elements drive
UUID=4655386a-5ccf-4c7b-ad6a-c0b90ccf8454 /home/privatenoob/media/storage1 xfs defaults 0 0

radarr.service:

[Unit]
Description=Radarr Movie Server
After=network.target

[Service]
ExecStart=podman run --name=radarr -e PUID=1000 -e PGID=1000 -e UMASK=002 -p 7878:7878 -v radarr-config:/config -v /home/privatenoob/media/storage1/Filmek:/data --restart unless-stopped lscr.io/linuxserver/radarr:latest
ExecStop=podman stop radarr
Restart=on-failure

[Install]
WantedBy=default.target

Permissions:

drwxr-xr-x. 2 privatenoob privatenoob 6 Jan 17 16:52 Filmek

drwxr-xr-x   4 abc    users    139 Jan 18 19:44 config
drwxr-xr-x   2 root   root       6 Jan 17 15:52 data

chown -R 1000:1000 /data didn’t work. It gave permission denied, even though I used root (probably this is because of -e PUID=1000?)

  • genie@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    There are a few ways around it. The simplest is to add the --privileged option.

    The more secure method with podman is by specifying a user (ex -u 10001:10001) from your extended subuid:subgid range after your full and proper setup of rootless podman :-)

    Then instead of chown you’ll want to use the oddly named podman unshare tool to automatically set the permissions of the host directory. You would then want to start your service with systemctl --user instead of sudo systemctl

  • Shjosan@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Drop the / in “/data” for the chown command. Now it is looking for a data folder in root, and not the one in “Filmek”.

    Don’t know if it will help with your issue thou

  • un_ax@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Try running the chown outside of the container: chown -R 1000:1000 /home/privatenoob/media/storage1/Filmek

    • PrivateNoob@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      1 year ago

      I’m doing rootless most likely, I just use the default Rocky Linux 9 setup with the Container Tools option turned on while the setup process. This didn’t work either for me. Did you start the service in sudo systemctl or in systemctl --user mode? Thanks for your help!

      • falcon15500@lemmy.nine-hells.net
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        1 year ago

        Hey, sorry for the late reply. I am running rootless using a dedicated user, so I use systemctl --user to control the container. From what I understand, when running rootless the root user inside the container correlates to the outside user (which is running the container), in terms of permissions. The external directories I bind mount into the container as externally owned by my dedicated user, so that the root user inside the container owns them (inside the container).

  • Djoot@feddit.dk
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    On my OpenSuse server I had to add :Z after /data in the bind, dont know if it applies to your setup, but it is easy to test and see if it works