Not able to delete a dir !!!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Not able to delete a dir !!!
# 1  
Old 01-31-2012
Not able to delete a dir !!!

Hi All,
One of the dir has a subdir in it. Subdir has no files in it. I verified it using ls -la command.

When I try to remove this subdir, it says that this directory is not empty.

Smilie

It does not show any files under it, so what could be the issue??

Appreciate help in this.....

Thanks in advance.

---------- Post updated at 01:15 AM ---------- Previous update was at 01:12 AM ----------

I tried to give 777 mod to subdir and dir and tried to delete the direct directory

/dir/subdir

It says I/O error

So I guess there is some sort of disk error, correct??
# 2  
Old 01-31-2012
Did you try rm -f /dir/subdir ?
# 3  
Old 01-31-2012
Just thoughts:
Did you do a df -k to see where on what is the subdirectory?
Did you check no process is accessing that subdir: fuser -cu <subdir or file system>
# 4  
Old 01-31-2012
Please post real directory listings in "ls -lisaR" format, the exact command typed and the exact error message with all punctuation.

Also try "find" to see if it names the missing files:
Code:
find /dir -print

What Operating System and version is this?

Does the bad directory appear in /etc/fstab ? i.e. is it a mountpoint?

Do you have a good and recent backup? If not, don't reboot until you have saved what you can.
Normally this sort of fault can be either cleared silently or made into a firm fault by cold rebooting the computer. This should force a hardware check and if the disc has not failed trigger a "fsck" on the filesystem.
# 5  
Old 02-02-2012
Hi All,
Thanks for your replies. I will try to post the answer to questions posed by various folks.

This is on AIX V5.3. There is a subdir called PowerCenter in main file system /opt/informatica.

/opt/informatica/PowerCenter contains another subdir called ia_jre_extraction_dir_6222.tmp

1) I went to /opt/informatica and issued following command:
Code:
       rm -rf PowerCenter/ia_jre_extraction_dir_6222.tmp

and it did not work.

2) I tried doing fuser -cu PowerCenter/ia_jre_extraction_dir_6222.tmp
and it shows following output
Code:
PowerCenter/ia_jre_extraction_dir_6222.tmp:    598406c(zdadmin)

So not sure if 598406 is a process, I did not see in list when I issue "ps -ef" command.

3) When I issue the command
Code:
    ls -lisaR   PowerCenter/ia_jre_extraction_dir_6222.tmp

I get the response
Code:
PowerCenter/ia_jre_extraction_dir_6222.tmp/jre not found
total 4
281216    0 drwxr-xr-x    3 zdadmin  zdupdt          256 Jan 31 17:00 .
225258    4 drwxrwxr-x    4 zdadmin  zdupdt         4096 Jan 31 23:33 ..

Mount point is /opt/informatica.

Does the bad directory appear in /etc/fstab ?

I did not see /etc/fstab, is it a text file??

Should I ask my UNIX Admin to reboot the server and see if the I/O errors related to filesystem are resolved.

Moderator's Comments:
Mod Comment Please use next time code tags for your code and data

Last edited by vbe; 02-02-2012 at 12:56 PM..
# 6  
Old 02-02-2012
I/O error is bad. It means that the system is physically unable to do what you're asking it to because the disk is not responding as expected. And you ignored the question about whether you have a recent backup, so I'm assuming you don't.

Rebooting isn't a good idea in these circumstances. What if the system just doesn't boot again? You'll have lost your last chance to recover your data.

BACK UP IMMEDIATELY. Do not wait. The disk may be DYING.
# 7  
Old 02-02-2012
This deleted file or directory is still open by process ID 598406 under user xdadmin :
PowerCenter/ia_jre_extraction_dir_6222.tmp/jre
It should show in:
Code:
ps -fp598406

I expect that you are going to need to shut down Informatica as tidily as possible, reboot and repair any damage to Informatica data (possibly be restoring deleted files and directories from backup) before restarting Informatica.

The I/O error message is ominous unless it comes from a Java application. Still advisible to take a new backup before rebooting.

Last edited by methyl; 02-02-2012 at 12:38 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Assign read write permission to the user for specific dir and it's sub dir and files in AIX

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. I do not want to assign user the same group of that directories too.... (0 Replies)
Discussion started by: blinkingdan
0 Replies

2. UNIX Desktop Questions & Answers

How to delete dir and sub dir

Guys, can you tell me how to delete directory and sub directory with files in them, for example: /system/upgrade/title/sub/var/vito/ I would like to delete 'title' and everything under it. Every sub dir contains files which need to be deleted as well. Thanks (1 Reply)
Discussion started by: DallasT
1 Replies

3. Shell Programming and Scripting

Any command to delete files from source dir after SFTP copy

Hi, I am currently using SFTP 'put' command to copy all files to remote server and then delete the copied files from source directory. Can anyone help me with a single command to copy and remove files in one go? Thanks and Regards, Chetan Vyas (5 Replies)
Discussion started by: chetancrsp18
5 Replies

4. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

5. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

6. Shell Programming and Scripting

How to delete files in specific dir

I've got a problem how to delete files from specific directory. I don't want do it recursively but only in specific directory. So, command like find /home/dirname/ -mtime +8 -type f -exec rm {} \; is not for me because this command will remove ifs files in /home/dirname and all... (2 Replies)
Discussion started by: zukes
2 Replies

7. Shell Programming and Scripting

Delete an empty file from dir.

Hi, I have an dir which has 50K file, some of them are empty. I want to delete the empty file from the dir. I am planning to use the following command. ls -l | grep " 0 " | awk '{print $9}' I can copy this to an file and then how do I use this file to delete the empty files.... Any help... (2 Replies)
Discussion started by: Script40
2 Replies

8. UNIX for Dummies Questions & Answers

Based on the permision in the dir can i delete the file

All, I am having a directory as drwxrwsr-x 3 intermec intermec 10240 Jan 8 09:07 intermec inside the directory . the files are like cd -rw-r----- 1 intrmc01 intermec 5226 Dec 2 15:03 AST07356.txt -rw-r----- 1 intrmc01 intermec 5025 Dec 2 12:51... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

9. Solaris

Auto delete files in /tmp dir ???

I have a Solris 9 box my problem is when I restart my box all my files and dirs in /tmp dir will be deleted exept 2 directories I found them since installation phase !!!! How to keep my files at that dir " /tmp " even after restarting ??? (1 Reply)
Discussion started by: DarkSoul
1 Replies

10. Shell Programming and Scripting

a script to clone a dir tree, & overwrite the dir struct elsewhere?

hi all, i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ... specifically, i'd like to: (1) specify a src directory (2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs (3) clone that same, empty dir hierarchy to... (2 Replies)
Discussion started by: OpenMacNews
2 Replies
Login or Register to Ask a Question