From 417d958a1477295511bef53c8ddf25b2b61801a7 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Tue, 9 Jan 2024 10:29:53 +0100 Subject: [PATCH] document how to remove a directory created with unshare mode --- mmdebstrap | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mmdebstrap b/mmdebstrap index 143a489..6f55302 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -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 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