[SOLVED] I can't delete a nobody:nogroup directory from a container

el_pedr0

Renowned Member
Aug 5, 2016
24
3
68
47
Hi,

I've got a legacy mount point in a container that is owned by nobody:nogroup and I can't rmdir it or chown it, even as root. Can anyone advise how I can remove this directory?

This situation arose when I specified a bind mount in the lxc .conf file without first creating a mount point in the container. The system must have created the bind point and mounted the bind mount when first starting up the container. Since then, I've removed that bind mount from the .conf file, so nothing is mounted at the mount point. Now in the container I'm left with the mount point.

Code:
root@photos:/mnt# whoami
root
root@photos:/mnt# ls -al
total 10
drwxr-xr-x  4 root        root         4 Mar 13 21:25 .
drwxr-xr-x 21 root        root        21 Mar 14 09:38 ..
drwxr-xr-x  3 nobody      nogroup      3 Mar 13 09:18 Library
root@photos:/mnt# rm -rf Library
rm: cannot remove 'Library/Pictures': Permission denied
root@photos:/mnt# chown root Library
chown: changing ownership of 'Library': Operation not permitted
 
you need to remove it from hypervisor context, it's likely owned by the real root which has no mapping inside the unprivileged container. e.g., 'pct mount XXX' should give you access (don't forget to unmount when you're done).
 
  • Like
Reactions: el_pedr0

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!