this works:
podman run -it --rm -v /home/myuser/test:/test:z alpine /bin/sh
this doesn’t: (mind that /mnt/data
is a mount point for second drive)
podman run -it --rm -v /mnt/data/test:/test:z alpine /bin/sh
It fails with the message:
Error: crun: error stat'ing file `/mnt/data/test`: Permission denied: OCI permission denied
The test directory is owned by the user launching the container so I don’t think it’s a straightforward permissions issue nor it’s about SELinux. I suspect cgroup v2 issues but I can’t seem to find a decent guide on how to set up.
Something’s strange.
when I try the same but on my (internal) backup drive, it works. Volume mounts without any permission problems. I don’t know if it’s related but the data drive is ext4 and the backup is xfs.
It’s been a while on this, but I’m running into the same exact issue.
From digging around, I’ve seen these recommendations:
- Add
--group-add keep-groups
to the podman
command-line
- Add
shared
to the ext4 mount options
- Check if you get the same error with
--runtime=runc
from the podman
command-line
- Try adding
--privileged
to the podman
command-line
For me, my container was already privileged (rootless), and I added the shared
option to my ext4 mount and --group-add keep-groups
to my podman
command. None of that did anything. But when I used the runc
runtime instead of the default crun
runtime, it did work without complaint.