Pihole Docker-Compose Volume Permissions Issue on USB

The issue I am facing:
I have a docker compose file for pihole as follows:

  # More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    hostname: kiwi.hole
    # For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      # - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
      - "9999:80/tcp"
    environment:
      TZ: "America/Toronto"
      WEBPASSWORD: ''
      VIRTUAL_HOST: 'kiwi.hole'
      DNS_BOGUS_PRIV: 'true'
      DNS_FQDN_REQUIRED: 'true'
      REV_SERVER: 'true'
      REV_SERVER_DOMAIN: 'local'
      REV_SERVER_TARGET: '192.168.1.1'
      REV_SERVER_CIDR: '192.168.1.0/24'
    labels:
        com.centurylinklabs.watchtower.enable: "true"
    # Volumes store your data between container upgrades
    volumes:
      - "/media/usb/pihole/etc/etc-pihole:/etc/pihole"
      - "/media/usb/pihole/etc/etc-dnsmasq.d:/etc/dnsmasq.d"
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    cap_add:
      - NET_ADMIN # Recommended but not required (DHCP needs NET_ADMIN)
    restart: always

When I start pihole I get errors related to permissions.

pihole              | chown: changing ownership of '/etc/pihole/dhcp.leases': Operation not permitted
pihole              | chown: changing ownership of '/etc/pihole': Operation not permitted

When I specify a volume that is on the local system I do not see errors and some of the files are owned by systemd-coredump. My Fstab is as follows and I have tried with and without umask=000 and the issues are the same.

UUID=B2AB-22A4 /media/usb vfat auto,umask=000,defaults 0 2

I need the volume on a usb because my main drive is running out of space (thin client with only 12GB of space).
Details about my system:
Think client Dell Wyse 3040 running ubuntu server.
What I have changed since installing Pi-hole:
As detailed above, I am trying to modify the volume directory.

I have a feeling I just need to add some user to some group or something or my fstab mount is wrong... docker does not seem to have any issues modifying the permissions of files in the volume when it is on the local disk so this is my assumption.

Thanks for any help offered!

fat/fat32/vfat file systems are not able to run chown or chmod. The filesystem that you use needs to be able to handle file metadata like ext4 and others.

2 Likes

:facepalm: this looks like what the issue was, thanks!

1 Like

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