Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 863
  • Last Modified:

mkdir -p <dir> hangs

Attempting to execute "mkdir -p /home/dfred/app/logdir-2007-08-09" hangs as if deadlocked. The process can not be backgrounded or killed. We've tried this several times. A "ps -ef | grep mkdir" shows:

dfred 27546     1  0 09:54 ?        00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred 28107     1  0 09:59 ?        00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred 29676     1  0 10:12 pts/19   00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred 29906     1  0 10:15 pts/19   00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred 30276     1  0 10:18 ?        00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred 30405     1  0 10:19 ?        00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred 30811     1  0 10:23 ?        00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred  1238     1  0 10:55 pts/19   00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred  3736     1  0 11:23 ?        00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred  4240     1  0 11:27 pts/106  00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred  4404     1  0 11:29 pts/106  00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred  5032     1  0 11:35 ?        00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09
dfred  5120     1  0 11:35 ?        00:00:00 mkdir -p /home/dfred/app/logdir-2007-08-09


Manually creating the directory works (IE mkdir /home/dfred/app/logdir-2007-08-09). Additional info: several other users are also logged in as dfred and may be accessing the app directory. One of them may have possibly tried to execute the same command even. Could this be the cause of the deadlock?

I greatly appreciate any help in understanding why this command hangs.

uname info: 2.4.21-32.0.1.ELhugemem #1 SMP Tue May 17 17:43:22 EDT 2005 i686 athlon i386 GNU/Linux
0
mkatmonkey
Asked:
mkatmonkey
  • 2
2 Solutions
 
ravenplCommented:
Can You try
strace mkdir -p /some/dir
and see where it hangs?

Also, verify if there are some hdd/fs errors with command
dmesg
0
 
mkatmonkeyAuthor Commented:
Thanks!

dmesg showed a couple dozen messages reading:
nfs: server blah-blah-server not responding, still trying
nfs: server blah-blah-server OK

doing strace on 'ls /home' which is also hanging yields this:

...
set_thread_area({entry_number:-1 -> 6, base_addr:0xf65ef080, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0xf65f1000, 27419)               = 0
brk(0)                                  = 0x8a8a000
brk(0x8aab000)                          = 0x8aab000
brk(0)                                  = 0x8aab000
rt_sigaction(SIGTERM, {0x80499b0, [TERM], SA_RESTORER|SA_RESTART, 0x9a4eb8}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGKILL, {0x80499b0, [KILL], SA_RESTORER|SA_RESTART, 0x9a4eb8}, {SIG_DFL}, 8) = -1 EINVAL (Invalid argument)
rt_sigaction(SIGSTOP, {0x80499b0, [STOP], SA_RESTORER|SA_RESTART, 0x9a4eb8}, {SIG_DFL}, 8) = -1 EINVAL (Invalid argument)
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
stat64("../", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
open("../", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3,

0
 
Duncan RoeSoftware DeveloperCommented:
Looks like your problem is NFS. Depending how you mount NFS disks, it can be the case that attempting an operation on an NFS mounted disk will wait indefinitely for the server to respond. This is actually the normal case. You can mount NFS disks "interruptible" which means an interrupt is honored ... eventually (after quite a long timeout, IIRC).
0
 
mkatmonkeyAuthor Commented:
Our sys admins rebooted the machine. Looks like whatever NFS problems were occurring may have been resolved by another group.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now