brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: run Docker Safe New Perms after you copy files to a container share as root

Docker
~/tips/tip-unraid-docker-safe-new-perms

cat ~/tips/tip-unraid-docker-safe-new-perms.md

Fix the permissions on files you copied as root so containers and users can write them again.

Everything you do in the Unraid terminal, you do as root. That is fine until you copy a pile of files into a share and Sonarr, Radarr or your Windows laptop suddenly can not touch them.

The Unraid docs describe the cause in their section on copying files from the command line: if you copy files as root via the terminal, they may end up with restrictive permissions. They point to two tools for the fix:

  • New Permissions from the Tools menu in the WebGUI
  • Docker Safe New Perms if you are dealing with shares that Docker containers use

The goal according to the docs is to reset permissions so all users have network access again.

The split matters on a server with a lot of containers. Your appdata share holds files that containers own on purpose, often with the IDs you set in the template, like PUID=99 and PGID=100. That is why the docs name a separate Docker safe tool for those shares. So my advice: if the files you copied are anywhere near container data, pick the Docker safe variant.

A typical case is copying a folder of films into /mnt/user/media with rsync or Midnight Commander. Afterwards your media containers can read them, but an app that wants to rename or move them gets a permission error. Run the tool on that share, then try again.

The caveat is the choice between the two. The docs reserve the Docker safe one for shares your containers touch, and on a server like mine that is most of them, so when in doubt I’d pick that one.

Further reading: Unraid docs: Command line interface, Unraid docs: Managing & customizing containers

Going deeper: Guide: your Unraid cache is full and Docker stopped, how to find out why and fix it

More Docker tips ONBUILD RUN /usr/local/bin/python-build --dir /app/src SHELL ["/bin/bash", "-c"] docker commit <container> myname/testimage:version3 docker import /path/to/exampleimage.tgz docker compose events All Docker tips (192) All topics

Link