In AIX 5.2, the du, find and tar command will sometimes fail in some directories. But, they can be run successfully in some other directories. Why this happens ? It is all because of the filesystem mounting.
It is very natural to mount numerous filesystems in AIX. Usually, a filesystem is mounted onto a directory of the same name in another filesystem. For example, under the ROOT filesystem, there are numerous other filesystems mounted onto many directories. When you ls these directories, you are actually getting the access permission of the AFTER-MOUNTED image. However, in AIX 5.2, the technical aspect of some commands such as find and tar will check the access permission of the BEFORE-MOUNTED directory. As a result, even the ls command reports a permission of 777 for the directory, the access permission of the BEFORE-MOUNTED underlying directory may have a permissoin of 700. Then, the find or tar command will certainly fail.
Since the ls command (and many other commands) will only reports the access permission of the AFTER-MONUTED image, how to know about the access permission of the before image ? The answer is to check the inode information. But, how to do so ?
ncheck | grep -e ':$' /usr/your/directory
|
:
:
/dev/hd1:
1996 /usr/God/directory
1997 /usr/your/directory
1998 /usr/others/directory
:
:
|
istat 1997 /dev/hd1
|
You will certainly get the access perssions which is very different to that got from the ls command. This is the access permission of the underlying directory.