mkdir: cannot create directory

Hi, I have network mount on two servers.

One server I can create any directories without any issues, other server with the similar mount, I am not able to create directories starting with number!

Creation, name start with a number:

[user1@www1 shareddoc]$ mkdir 1212
mkdir: cannot create directory `1212': No such file or directory

Creation, name start with a letter:

[user1@www1 shareddoc]$ mkdir a1212
[user1@www1 shareddoc]$ rm a1212
rm: cannot remove `a1212': Is a directory

The directory created successfully!

Both servers similar user account and mounting methods are used. Any ideas?

Not sure I understood the issue (..)
Have you tried to see what command you were executing ( a fake, or an alias?)
check with what, which, whereis commands to see if it can explain...

Thanks for reply vbe...
The results for all these WH questions were same.

What OS(es) are you running ?

RHEL 4

Then what says:

strace -f mkdir 1212

?

1 Like

Perhaps an alias? have you tried:

\mkdir 1212

I don't think this could be an issue with an alias, can you not create a directory called "cd"?

Just for giggles can you try this:
mkdir ./1212

If this works we can go from there.

Hi

# strace -f mkdir 1212
execve("/bin/mkdir", ["mkdir", "1212"], [/* 27 vars */]) = 0
uname({sys="Linux", node="websitename.com", ...}) = 0
brk(0)                                  = 0x948f000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=98463, ...}) = 0
old_mmap(NULL, 98463, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fa7000
close(3)                                = 0
open("/lib/libselinux.so.1", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260\220"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=56328, ...}) = 0
old_mmap(0x4fa7000, 56144, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4fa7000
old_mmap(0x4fb4000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd000) = 0x4fb4000
close(3)                                = 0
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\276"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1454802, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa6000
old_mmap(0xa07000, 1223900, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa07000
old_mmap(0xb2c000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x124000) = 0xb2c000
old_mmap(0xb30000, 7388, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb30000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa5000
mprotect(0xb2c000, 4096, PROT_READ)     = 0
mprotect(0x9fe000, 4096, PROT_READ)     = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7fa56c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0xb7fa7000, 98463)               = 0
access("/etc/selinux/", F_OK)           = 0
brk(0)                                  = 0x948f000
brk(0x94b0000)                          = 0x94b0000
open("/etc/selinux/config", O_RDONLY)   = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=448, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fbf000
read(3, "# This file controls the state o"..., 4096) = 448
close(3)                                = 0
munmap(0xb7fbf000, 4096)                = 0
open("/proc/mounts", O_RDONLY)          = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fbf000
read(3, "rootfs / rootfs rw 0 0\n/proc /pr"..., 1024) = 895
close(3)                                = 0
munmap(0xb7fbf000, 4096)                = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=48528816, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7da5000
close(3)                                = 0
umask(0)                                = 022
umask(022)                              = 0
mkdir("1212", 0777)                     = -1 ENOENT (No such file or directory)
stat64("1212", 0xbffeb4a0)              = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2528, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7da4000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2528
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0xb7da4000, 4096)                = 0
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "mkdir: ", 7mkdir: )                  = 7
write(2, "cannot create directory `1212\'", 30cannot create directory `1212') = 30
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": No such file or directory", 27: No such file or directory) = 27
write(2, "\n", 1
)                       = 1
exit_group(1)                           = ?
Process 15730 detached

and here is

\mkdir 1212
mkdir: cannot create directory `1212': No such file or directory

and

# mkdir ./1212
mkdir: cannot create directory `./1212': No such file or directory

What says:

pwd
mount
mkdir a1212
mv a1212 1212
strace -f mv a1212 1212
ls -lad "$PWD"
rpm -Vv coreutils | grep mkdir

on both clients.

Please note, this issue is not with mount, I cannot create directory anywhere with a numeric name.

# pwd
/root
# mkdir a1212
# mv a1212 1212
mv: cannot move `a1212' to `1212': No such file or directory
# rpm -Vv coreutils | grep mkdir
.......T.   /bin/mkdir
......... d /usr/share/man/man1/mkdir.1.gz

---------- Post updated at 02:41 PM ---------- Previous update was at 02:26 PM ----------

# touch 1111
touch: cannot touch `1111': No such file or directory

Any solution other than re installation?

Apparently, your server has been compromised by some javascript virus.

Web Hosting Talk - View Single Post - Linux servers having CPANEL - js virus hitting

Slightly off topic

Should be "rmdir" not "rm"

rmdir a1212

On topic, please post the permissions of the directories and the Operating System and version:

ls -lad /
ls -lad /root
uname -a

Were you logged in as "root" at the time of the problem?