document how to remove a directory created with unshare mode

This commit is contained in:
Johannes Schauer Marin Rodrigues 2024-01-09 10:29:53 +01:00
parent 8674e11c71
commit 417d958a14
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -6920,6 +6920,11 @@ available and you know your subuid/subgid offset (100000 in this example):
$ sudo systemd-nspawn --private-users=100000 \
> --directory=./debian-rootfs /bin/bash
A directory created in B<unshare> mode cannot be removed the normal way.
Instead, use something like this:
$ unshare --map-root-user --map-auto rm -rf ./debian-rootfs
If this mode is used as the root user, the user namespace is not unshared (but
the mount namespace and other still are) and created directories will have
correct ownership information. This is also useful in cases where the root user