Hi, Quoting Helmut Grohne (2024-01-12 21:58:00) > > What can cause mkfs.ext4 to fail with a "Permission denied" error? > I think this is our typical problem when dealing with user namespaces. I > guess that the thing that fails here is mkfs.ext4 opening the target image > file (to be formatted). That file has earlier been chowned to the root uid > inside the namespace, so permission should be there, but you need more. You > also need execute permission (to the first uid of your namespace) for the > containing directory up until the root. I guess that none of those are > world-executable and not by chanced owned by your first subuid nor owned by > the first group in your subgid range.
I'm not yet convinced that this is it. The problem occurs for Francesco when using either /tmp or /dev/shm as a temporary directly. By default, those two locations should have the desired permission bits set. Lets check whether world-execute permissions are set for all directories up until root. I have this: $ stat -c "%a %n" / /dev /dev/shm /tmp 755 / 755 /dev 1777 /dev/shm 1777 /tmp Francesco, what are the world execute permissions on all path components up to /tmp and /devv/shm in your case? Arguably, mmdebstrap maybe should do this check at start-up. To have a real-world test-case for such a feature, I'm eager to see how Francesco's system looks like. Thanks! cheers, josch
signature.asc
Description: signature