Permissions issues?

TLDR edit for future viewers:

I had a docker container editing file permissions on startup.

Creating a bug report/issue

I have searched the existing open and closed issues

I am experiencing 2 problems and I’m unsure if they’re related but as far as I can tell they started happening at the same time.

  • My mounted drive’s permissions keep getting reset
  • My jellyfin plugins configurations will not save

Required Information

  • DietPi version
❯ cat /boot/dietpi/.version 
G_DIETPI_VERSION_CORE=9
G_DIETPI_VERSION_SUB=19
G_DIETPI_VERSION_RC=2
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
  • Distro version
echo $G_DISTRO_NAME $G_RASPBIAN

  • Kernel version
❯ uname --all
Linux Tui 6.12.47+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.47-1+rpt1~bookworm (2025-09-16) aarch64 GNU/Linux
  • Architecture
❯ dpkg --print-architecture
arm64
  • SBC model RPi4 (echo $G_HW_MODEL_NAME → blank)
  • Power supply used unknown
  • SD card used unknown

Additional Information (if applicable)

Something keeps changing my file permissions on my mounted drive and all subdirectories to 99 / users and it’s breaking permissions for my services

❯ ls -l /mnt/drive
total 56
drwxrwsr-x+ 10 99 users  4096 Dec  6 01:54 Anime
drwxrwsr-x+  2 99 users 16384 Aug  4  2022 lost+found
drwxrwsr-x+ 28 99 users  4096 Dec  6 01:54 movies
drwxrwsr-x+  2 99 users  4096 Sep 22  2022 other
drwxrwsr-x+ 22 99 users  4096 Dec  9 00:16 television
drwxrwsr-x+  5 99 users  4096 Dec  9 00:14 temp

When I save my jellyfin settings, one directory gets the new saved file but the other does not

❯ ls -l /mnt/dietpi_userdata/jellyfin/plugins/configurations/
total 12
-rw-r--r-- 1 jellyfin jellyfin 3899 Dec  9 01:59 IntroSkipper.xml
-rw-r--r-- 1 jellyfin jellyfin  299 Dec  9 01:59 Jellyfin.Plugin.MusicBrainz.xml
-rw-r--r-- 1 jellyfin jellyfin  565 Dec  9 01:59 Jellyfin.Plugin.Tmdb.xml
❯ ls -l /mnt/dietpi_userdata/jellyfin/data/plugins
total 0

Steps to reproduce

the mounted subdirectories just intermittently change, some times it happens on reboot and sometimes it seems to happen later

Expected behaviour

I run these

sudo chown -R jellyfin:jellyfin /mnt/drive
sudo chmod 2775 /mnt/drive
sudo find /mnt/drive-type d -exec chmod 2775 {} +
sudo setfacl -R -m g:jellyfin:rwx /mnt/drive
sudo setfacl -d -m g:jellyfin:rwx /mnt/drive

file permissions should change?


For jellyfin, when i save settings, they should be saved to both
/mnt/dietpi_userdata/jellyfin/plugins/configurations/
/mnt/dietpi_userdata/jellyfin/data/plugins

Actual behaviour

  • mounted drive permissions get reset
  • jellyfin settings only save to /mnt/dietpi_userdata/jellyfin/plugins/configurations/ and they get deleted upon jellyfin restarting (which is expected behaviour for jellyfin I believe)

Extra details

  • As far as I can tell jellyfin has all the permissions it needs for the plugin directories

Here is my fstab

❯ cat /etc/fstab
# You can use "dietpi-drive_manager" to setup mounts.
# NB: It overwrites and re-creates physical drive mount entries on use.
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------


#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=1922M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf, glusterfs, mergerfs, bind, Btrfs subvolume
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAP SPACE
#----------------------------------------------------------------


#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=28a6ec92-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=28a6ec92-01 /boot/firmware vfat noatime,lazytime,rw 0 2
UUID=92a6518d-ef2a-4442-9de1-84e3fdba5c60 /mnt/drive ext4 noatime,lazytime,rw,noauto,x-systemd.automount
1 Like

Hello and welcome to the forum.

Interesting behaviour, by default die default mount options include acl, I just did a quick check:

root@RPi4:~# tune2fs -l /dev/sdb1 | grep "Default mount options"
Default mount options:    user_xattr acl

Can you post the output of

mount | grep /mnt/drive
getfacl /mnt/drive

This is expected, one dir is for the configs and the other only for the plugin data, not for configs.

just by any chance, did you connect this drive to a different computer?

Thank you! :smiley:

❯ mount | grep /mnt/drive
/dev/sda1 on /mnt/drive type ext4 (rw,noatime,lazytime,x-systemd.automount)
❯ getfacl /mnt/drive

getfacl: Removing leading '/' from absolute path names
# file: mnt/drive
# owner: jellyfin
# group: jellyfin
# flags: -s-
user::rwx
group::rwx
group:jellyfin:rwx
mask::rwx
other::r-x
default:user::rwx
default:group::rwx
default:group:jellyfin:rwx
default:mask::rwx
default:other::r-x

Yes some time in july I would’ve used it with my windows laptop but accessing the drive through WSL

Well, it’s mysterious. Maybe you have to specify the acl option in the fstab? But you said it worked before until now?

Do you have any user with this ID?

getent passwd 99
getent group 99

Let’s have a look who or what is resetting the permissions

journalctl -b --no-pager | grep -E 'sda1|/mnt/drive|chown|mount' -n

And we can also check when it happend

find /mnt/drive -maxdepth 2 -printf '%C@ %p\n' \
 | sort -n \
 | tail -n 20 \
 | awk '{cmd="date -d @"$1" \"+%F %T\""; cmd | getline d; close(cmd); print d, $2}'

As far as I can see, you have a user ID 99. So I did some Google search and asking ChatGPT on what this could be. Sometimes UID 99 is related to Docker container image or to a nfsnobody user used on NFS shares.

UUID=92a6518d-ef2a-4442-9de1-84e3fdba5c60 /mnt/drive ext4 noatime,lazytime,rw,noauto,x-systemd.automount

He’s using ACL and my understanding is, that on ext4 ACL settings are permanent and are reapplied on remount, it’s a default mount option and does not need to be applied in the fstab.
Same for permissions: it’s ext4, they are stored on the filesystem? I never experienced lost permissions after remount, on ext4.

For NTFS and exFAT your assumption might be true.

I never actively used ACLs, but is it possible they enforce owner and mode?

It didn’t happen since I last posted but I rebooted my system and got to see it happen in real time by accident.

I rebooted my system and ran ls -l /mnt/drive to make sure it hadn’t happened again and I saw it was okay.

Then I wanted to run a previous command, accidentally ran the ls again by mistake and got a different result.

Here’s the command outputs followed by the journal

There’s logs related to an “audit” process with the key “perms_watch”, This is something I setup to try and identify the problem but I didn’t understand what I’m dealing with well enough to use it properly.

I took a look through my docker compose files and most of them don’t specify a user except for authentik which is set to root. I user portainer if that’s worth mentioning.

I don’t have any network shares that I know of

Jellyfin’s settings aren’t being stored on the drive mounted at /mnt/drive, sorry if that was unclear. They’re located at /mnt/dietpi_userdata/jellyfin/data/plugins and /mnt/dietpi_userdata/jellyfin/plugins/configurations but as far as I understand this is some kind of virtual mount by dietpi? I don’t remember configuring any sort of behavior like this so I assumed it was normal? Either way, when the server is reboot or jellyfin restarts nothing persists in those folders, the only files to be found are recently generated.

Some container is changing the permissions, it has pid 2092

audit[...] comm="chown" exe="/usr/bin/chown" key="perms_watch"
uid=0 gid=0 pid=2092

PATH name="/mnt/drive/television/PLUR1BUS/"
ouid=99 ogid=100

You can find out which one with

ps -fp 2092
1 Like

You were right, it was Filerise. I made the mistake of assuming excluding optional settings would disable them.

I’ve begun migrating my jellyfin installation to a new pi so I’m going to ignore my problem with the settings not persisting for now. If I change my mind, I’ll make a new thread :slight_smile:

Thank you very much for your help on this folks!

1 Like