Parent directory seems to disappear if child fails rename


 
Thread Tools Search this Thread
Operating Systems AIX Parent directory seems to disappear if child fails rename
# 1  
Old 05-10-2011
Parent directory seems to disappear if child fails rename

If I have a file/folder that a user does not have permission to and I try to rename it, it removes the entire parent folder. At that point it is only visible in a ls. (Not a ls -l, file, more, cd). It happens on every filesystem. This is Aix 5.3
Code:
$ cd test
$ ls -la
total 0
drwxr-xr-x    2 root     system          256 May 10 18:26 .
drwxr-xr-x    3 dell      sysadmin        256 May 10 18:26 ..
-rw-r--r--    1 root     system            0 May 10 18:26 new
 
$ mv new new.old
mv: cannot rename new to new.old:
Permission denied
$ pwd
/home/dell/test
$ ls
test
$ ls -la
./test not found
total 0
drwxr-xr-x    2 root     system          256 May 10 18:26 .
drwxr-xr-x    3 dell   sysadmin        256 May 10 18:26 ..


Last edited by jim mcnamara; 05-10-2011 at 11:44 PM.. Reason: added filename; added code tags
# 2  
Old 05-13-2011
Is the FS maybe corrupted? Check first in errpt whether anything has been reported and / or unmount the FS and check it with fsck... Do you have the latest SPs for either TL10,11 or 12 installed? These introduced the possibility to corrupt JFS2 file systems by a simple "mv" command and should for now be avoided...
# 3  
Old 05-16-2011
nothing in errpt. I unmounted, ran fsck which came back clean. But strangely once I do that, the problem goes away for awhile but then eventually returns.

We are at 5300-12-03-1107.

Thanks so much for your response!
# 4  
Old 05-16-2011
I don't think we have enough information.

I suspect it MAY have something to do with the directory's name... "test"...
...which is the name if the shell command used in an 'if' statement (see man test)

Try re-running the test again.
But before doing so, run a
Code:
ls -ld /home/dell/test

and use "full paths" to everything...
In other words:

Code:
 
$ cd /home/dell/test
$ ls -la  /home/dell/test
$ ls -ld  /home/dell/test
$ mv /home/dell/test/new   /home/dell/test/new.old
$ pwd
$ ls -la
$ ls -ld /home/dell/test

# 5  
Old 05-16-2011
It happens no matter what the file is called. Question: If you mount a filesystem over a directory, do the underlying directory permissions have any real effect? The reason is that if we umount the filesystem and chmod 777 to the underlying directory and then remount the fs, the problem goes away for awhile.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Fail Parent Script if any of the child fails

I have requirement where I need to fail parent if any one of the child process fails. Here is the code snippet for i in 1 2 3 4 5 6 7 8 9 10 do child_script $i & done wait I need to fail my main script if any one of my child process fails (8 Replies)
Discussion started by: gvkumar25
8 Replies

2. UNIX for Beginners Questions & Answers

Rename the file name from Parent directory

Hi All, Just started learning unix and stuck into below issue. Suppose i have folder structure as below. Dir1/Dir2/Dir3/File1.msg I am looking to rename the file name from File1.msg to File2.msg but from the parent Dir1 From Dir3 i can easily run the command like mv File1.msg... (2 Replies)
Discussion started by: Gurjeet Singh
2 Replies

3. Shell Programming and Scripting

Parent Child directory and file details

Kindly help below command details in UNIX. 1.What is the Unix command to see parent and child directory details starting from root directory in tree structure using LS-LRT or any other way 2.What is the Unix command to see parent and child directory details starting from root directory in... (2 Replies)
Discussion started by: skp
2 Replies

4. UNIX for Dummies Questions & Answers

parent and child directory

does anyone know how to check in an 'if' statement if a particular directory is a child directory of a particular directory? help ~ (2 Replies)
Discussion started by: ymc1g11
2 Replies

5. Shell Programming and Scripting

forking a child process and kill its parent to show that child process has init() as its parent

Hi everyone i am very new to linux , working on bash shell. I am trying to solve the given problem 1. Create a process and then create children using fork 2. Check the Status of the application for successful running. 3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies

6. Homework & Coursework Questions

Need help with deleting childīs parent and child subprocess

1. The problem statement, all variables and given/known data: I need to make an program that in a loop creates one parent and five children with fork(). The problem i'm trying to solve is how to delete the parent and child of the childīs process. 2. Relevant commands, code, scripts,... (0 Replies)
Discussion started by: WhiteFace
0 Replies

7. UNIX for Dummies Questions & Answers

Parent/child directory permission

Hi there, I want to restrict a users account to only a subdirectory, but it does not seem to be working. For example /dir1/dir2/dir3/dir4 user A is only allowed to do things in dir4. the permission is 777. i've set the permissions to 700 on dir3, dir2, and dir1 to prevent them from... (3 Replies)
Discussion started by: newbie121
3 Replies

8. UNIX for Advanced & Expert Users

Child Killing Parent

Hi all, I am writing a script which calls other third party scripts that perform numerous actions. I have no control over these scripts. My problem is, one of these scripts seems to execute and do what it is meant to do, but my calling / parent script always exits at that point. I need to... (4 Replies)
Discussion started by: mark007
4 Replies

9. Filesystems, Disks and Memory

How hard can it be? ps child/parent

:( Since I'm fairly new to the scene and don't have much experience in shell programming, I decided to check out the net for a useful script or two. What I'm looking for is a script that would let me enter a PID and then show the process tree associated with it. So it would display the (grand-)... (2 Replies)
Discussion started by: velde046
2 Replies

10. UNIX for Dummies Questions & Answers

what are parent and child processes all about?

I don't follow what these are... this is what my text says... "When a process is started, a duplicate of that process is created. This new process is called the child and the process that created it is called the parent. The child process then replaces the copy for the code the parent... (1 Reply)
Discussion started by: xyyz
1 Replies
Login or Register to Ask a Question