Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tar problem: tar -cvzf /usr/local command gets hung

Status
Not open for further replies.

cibee

Programmer
Dec 15, 2004
38
US
Hi,

I'm trying to backup data before an upgrade and I'm trying the tar command

Code:
 tar -cvzf /home/BKP/usr_local_apache.tar /usr/local/apache/

but this command seems to get hung at a point. I'm not sure why. Space is not an issue. Is there anyway around this?

Thanks in advance,
Cibee.
 
Hi, Thanks for an early reply.

No, apache is not running.

and the size is

Code:
ls -l /usr/local/apache/logs/error_log

-rw-r--r--    1 root     root        15571 Jan  5 10:54 /usr/local/apache/logs/error_log

But the command gets hung at an empty dir which is
Code:
 /usr/local/apache/mason/cache/

Any lead is highly appreciated.
Cibee
 
Hi,

Tried omitting the "v" parameter.. but that doesn't seem to help. Still getting hung. : - (
Wonder why this is happening...
 
Hi
Tried that.

It gets hung at

Code:
usr/local/apache/mason/cache/
usr/local/apache/mason/cache/ingoreme.txt

Has it got anything to do permissions... I'm running this as root... Don't think that should be a problem.
 
Are you sure the dir is empty?

ls -al usr/local/apache/mason/cache/

If there are no hidden fifos or anything, it may actually be getting hung on whatever is *after* that directory.
 
This is what I got when I did ls -al

Code:
[root@BU1 /]# ls -al usr/local/apache/mason/
total 16
drwxr-xr-x    4 nobody   nobody       4096 Aug 29 22:48 .
drwxr-xr-x   15 root     root         4096 Oct 19 16:08 ..
drwxr-xr-x    2 nobody   nobody       4096 Jan  6 12:13 cache
drwxr-xr-x    4 nobody   nobody       4096 Aug 29 23:29 obj

dir obj is tared.

Code:
[root@BU1 /]# ls -al usr/local/apache/mason/cache/
total 8
drwxr-xr-x    2 nobody   nobody       4096 Jan  6 12:13 .
drwxr-xr-x    4 nobody   nobody       4096 Aug 29 22:48 ..
-rw-r--r--    1 root     root            0 Jan  6 12:13 ingoreme.txt

after that dir is an empty dir again called proxy.

Code:
[root@BU1 /]# ls -al usr/local/apache/proxy/
total 8
drwxr-xr-x    2 nobody   nobody       4096 Aug 29 17:36 .
drwxr-xr-x   15 root     root         4096 Oct 19 16:08 ..

How would I deal with this?
 
Try running tar with strace and see if that will give a clue as to what it's binding on.

strace tar -czvf ~/usr_local_apache.tar /usr/local/apache
 
Hey Eric,

That command stops at

Code:
munmap(0x4001a000, 4096)                = 0
write(1, "usr/local/apache/mason/cache/ing"..., 42usr/local/apache/mason/cache/ingoreme.txt
) = 42
lstat64("/usr/local/apache/leverage", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/local/apache/leverage", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY

when I do

Code:
[root@BU1 root]# ls -l /usr/local/apache/
total 52
drwxr-xr-x    2 root     root         4096 Aug 29 21:47 bin
drwxr-xr-x    2 root     root         4096 Aug 29 17:36 cgi-bin
drwxr-xr-x    7 root     root         4096 Aug 29 21:47 conf
drwxr-xr-x    7 500      500          4096 Oct 19 15:41 htdocs
drwxr-xr-x    3 root     root         4096 Aug 29 21:47 icons
drwxr-xr-x    3 root     root         4096 Aug 29 17:36 include
drwxr-xr-x    3 leverage leverage     4096 Jan 16  2004 leverage
drwxr-xr-x    2 root     root         4096 Aug 29 21:47 libexec
drwxr-xr-x    2 root     root         4096 Oct 19 16:10 log4perl
drwxr-xr-x    2 root     root         4096 Oct 19 18:10 logs
drwxr-xr-x    4 root     root         4096 Aug 29 17:36 man
drwxr-xr-x    4 nobody   nobody       4096 Aug 29 22:48 mason
drwxr-xr-x    2 nobody   nobody       4096 Aug 29 17:36 proxy
[\code]


I can't even ls on /usr/local/apache/leverage to find out what is in that dir ...  it gets hung. seems like a permission issue, cause htdocs and leverage should be owned by leverage user and something went wrong when these were initally created and htdocs gets tared. So this is the culprit... Not sure how to deal with this. will dig in somemore...

Thanks for your help.. any more tips most welcome.
Cibee
 
That sounds not good. If you're doing the tar as root, permissions can't be a problem, you may have a corrupted inode. I'd take the filesystem offline and fsck it.
 
Hi Eric,

Is there a way to change that? The server is offline...

Can't I just chown UID.GID to that?
 
I doesn't sound like a permission problem. See, if you're running as root the kernel doesn't even look at the permissions of the files, it skips the check completely. I think the most likely explanation is that your filesystem needs repairing.
 
Thanks guys for all your help. Let me dig into this some more.

Cibee
 
I had this happen once. I believe it ended up being an open socket.
 
The directory has 3 directory entries, which means '.', '..' and something else, which a socket or a fifo (as I mentioned) could screw up your tar. But the inability to ls the directory as root indicates, to me, a problem with the file system.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top