0

I have encountered a strange problem where the mkdir -p command fails to create a directory and returns the following error message:

[root@202 ~]# pwd
/root
[root@202 ~]# mkdir -p a/b/c
mkdir: cannot create directory ‘a’: No such file or directory

However, if I execute the same command in the root directory, it works fine:

[root@202 /]# pwd
/
[root@202 /]# mkdir -p a/b/c
[root@202 /]# ls -lhrt a/b
total 0
drwxr-xr-x 2 root root 6 Mar 13 15:06 c

I am currently logged in as the root user, so I don't think it's a simple permission issue.

Do you have any other ideas for troubleshooting?

The permissions of the /root directory are as follows:

[root@202 ~]# ls -lhart /
dr-xr-x---    2 root root  114 Apr  1  2016 root

And when I tried to modify the permissions of the /root directory, I encountered the same strange phenomenon:

[root@202 ~]# chmod a+w ~
chmod: changing permissions of ‘/root’: No such file or directory

I am currently working within a Docker container and the system is CentOS 7.

Docker version: 6e3bb8e/1.13.1 (released on 2017-02-08).

Thanks in advance.


The df of / and /root:

[root@202 /]# df -lh /root
Filesystem      Size  Used Avail Use% Mounted on
overlay         128G   14G  115G  11% /

If I try to create the /root directory (given the "No such file or directory" message earlier):

[root@202 /]# mkdir /root
mkdir: cannot create directory ‘/root’: File exists
10
  • @JaromandaX Yes, I've seen it later, so I deleted my comment. Commented Mar 13, 2023 at 8:30
  • hmmm ... overlay filesystem ... can you touch ~/foo? Commented Mar 13, 2023 at 8:30
  • Is it possible to provide us with a minimal reproducing example, e.g., a Dockerfile or publicly accessible Docker image that exhibits this behavior? Commented Mar 13, 2023 at 8:31
  • @Green绿色 It's not a public image, but I can show you the docker inspected information (I'm not familiar with docker, please tell me which one is required). The Dockerfile only installs some dependencies packages and runs a service process.
    – Mer
    Commented Mar 13, 2023 at 8:54
  • 1
    @ilkkachu In fact, the initial issue was the inability to install any packages via rpm, and the strace was not previously installed inside the container. And the issue was finally resolved by reboot...
    – Mer
    Commented Mar 13, 2023 at 12:03

0

You must log in to answer this question.

Browse other questions tagged .