f



Listing files in a directory

Hi.
I have a problem with one my hp-ux machine.
When I am in a directory and I try to get a list of the files in this
directory, sometimes I get a list of few files instead of the complete
list. I also see few directories. Here is an example:

I'm in this directory: /Prestito/KTE
I try to get the list of the content of this directory with the
command "ll". In the list I have to see 3 directories
(Acquisiti,Cancellati,DaAcquisire), but the command shows me only
"DaAcquisire". I don't know why. I can't execute the command "cd
Acquisiti" because the system doesn't see the directory. After 5
minutes (or more or less) I try again and all is perfect. I see all
the directories, I can enter in "Cancellati" and "Acquisiti". I can
get a list of the content of these directories. All is correct.

Can anyone help me? I'm only 20 years old so I don't have a lot
experience.
Excuse me for my english.
Thanks all.
Luigi
0
luigi
1/28/2004 10:51:22 AM
comp.sys.hp.hpux 4408 articles. 1 followers. dewi.bening (7) is leader. Post Follow

25 Replies
684 Views

Similar Articles

[PageSpeed] 56

Hi Luigi

> I'm in this directory: /Prestito/KTE
> I try to get the list of the content of this directory with the
> command "ll". In the list I have to see 3 directories
> (Acquisiti,Cancellati,DaAcquisire), but the command shows me only
> "DaAcquisire". I don't know why. I can't execute the command "cd
> Acquisiti" because the system doesn't see the directory. After 5
> minutes (or more or less) I try again and all is perfect. I see all
> the directories, I can enter in "Cancellati" and "Acquisiti". I can
> get a list of the content of these directories. All is correct.
It looks like your directory is not mounted from a local disk but 
mounted via NFS and/or automounter from another machine.

You should check this with the "mount -v" command.

If this is the case, we need to know more details: HPUX-Version of your 
machine, type of mount, NFS- and automounter patchlevel, the automounter 
maps (perhaps from NIS?), type of network connection, type of the 
NFS-Server machine, OS-version of the NFS Server, ....


Florian

-- 
mail an "fanwander AT mnet MINUS online PUNKT de"

0
Florian
1/28/2004 1:43:13 PM
This directory is not mounted via NFS. It is a local one.


luigi.mazzucchetti@inwind.it (Gigi) wrote in message news:<3945e1c3.0401280251.3563686b@posting.google.com>...
> Hi.
> I have a problem with one my hp-ux machine.
> When I am in a directory and I try to get a list of the files in this
> directory, sometimes I get a list of few files instead of the complete
> list. I also see few directories. Here is an example:
> 
> I'm in this directory: /Prestito/KTE
> I try to get the list of the content of this directory with the
> command "ll". In the list I have to see 3 directories
> (Acquisiti,Cancellati,DaAcquisire), but the command shows me only
> "DaAcquisire". I don't know why. I can't execute the command "cd
> Acquisiti" because the system doesn't see the directory. After 5
> minutes (or more or less) I try again and all is perfect. I see all
> the directories, I can enter in "Cancellati" and "Acquisiti". I can
> get a list of the content of these directories. All is correct.
> 
> Can anyone help me? I'm only 20 years old so I don't have a lot
> experience.
> Excuse me for my english.
> Thanks all.
> Luigi
0
luigi
1/28/2004 3:57:26 PM
Gigi <luigi.mazzucchetti@inwind.it> wrote:
> This directory is not mounted via NFS. It is a local one.
Did you check syslog and messages if there are any problems with your
filesystem?

urle

-- 
Uli Betzler (urle)                                  urle@rz.uni-karlsruhe.de
Universitaet Karlsruhe, Rechenzentrum IRA/VERA/SR, Zirkel 2, 76128 Karlsruhe
phone: +49 721 608-4039  FAX: +49 721 608-9013  alternate FAX: +49 721 32550
urle = URL-Emanation = http://www.uni-karlsruhe.de/~Ulrich.Betzler/urle.html
0
urle
1/29/2004 4:25:15 AM
urle - Uli Betzler <urle@rz.uni-karlsruhe.de> wrote in message news:<bva1vb$nai$1@news.rz.uni-karlsruhe.de>...
> Gigi <luigi.mazzucchetti@inwind.it> wrote:
> > This directory is not mounted via NFS. It is a local one.
> Did you check syslog and messages if there are any problems with your
> filesystem?
> 
> urle

Yes, and I didn't find any problem.
0
luigi
1/29/2004 12:17:18 PM
Hi Luigi

> This directory is not mounted via NFS. It is a local one.
Which HPUX Version?

What is the highest PHKL_....  Patchnumber Number?
  (get it with swlist -l product | grep PHKL

I remember a similar defekt in very low HFS and VxFS Patch levels 
(highest PHKL_Number below 16000)

Florian
-- 
mail an "fanwander AT mnet MINUS online PUNKT de"

0
Florian
1/29/2004 4:51:30 PM
Florian Anwander <spam.interessiert.nicht@mnet-online.de> wrote in message news:<bvbdi7$q2t7h$1@ID-180218.news.uni-berlin.de>...
> Hi Luigi
> 
> > This directory is not mounted via NFS. It is a local one.
> Which HPUX Version?
> 
> What is the highest PHKL_....  Patchnumber Number?
>   (get it with swlist -l product | grep PHKL
> 
> I remember a similar defekt in very low HFS and VxFS Patch levels 
> (highest PHKL_Number below 16000)
> 
> Florian

HP-UX versione is 11.00
The highest PHKL number is PHKL_27813.
0
luigi
1/30/2004 7:24:25 AM
Hi Luigi

> HP-UX versione is 11.00
> The highest PHKL number is PHKL_27813.
Ok, this looks like a reasonable patched machine, supposed the patches 
are installed correct (*)


Befor I continue: I always assume, that you have these problems as root! 
If you have them as normal user it migth be that some one else is 
changing the permissions temporarily.

Some further questions:
Is this a node of a MC/ServiceGuard cluster?
Are the subdirectory entries real subdirecories or are they links to 
some other directories?
If they are real subdirs: Are these subdirectories all on the same 
filesystem or are they on different filesystems?

Florian





(*) You may check this with:
       swlist -l fileset -a state | grep -v "#" | grep -v configured
     it should return nothing. If there are  lines with "installed"
     or "transient" something is wrong.

-- 
mail an "fanwander AT mnet MINUS online PUNKT de"

0
Florian
1/30/2004 9:35:35 AM
When you can see all files and directories, do a "ls -la" and post the 
output.


Florian Anwander wrote:

> Hi Luigi
> 
>> HP-UX versione is 11.00
>> The highest PHKL number is PHKL_27813.
> 
> Ok, this looks like a reasonable patched machine, supposed the patches 
> are installed correct (*)
> 
> 
> Befor I continue: I always assume, that you have these problems as root! 
> If you have them as normal user it migth be that some one else is 
> changing the permissions temporarily.
> 
> Some further questions:
> Is this a node of a MC/ServiceGuard cluster?
> Are the subdirectory entries real subdirecories or are they links to 
> some other directories?
> If they are real subdirs: Are these subdirectories all on the same 
> filesystem or are they on different filesystems?
> 
> Florian
> 
> 
> 
> 
> 
> (*) You may check this with:
>       swlist -l fileset -a state | grep -v "#" | grep -v configured
>     it should return nothing. If there are  lines with "installed"
>     or "transient" something is wrong.
> 
0
Trond
1/30/2004 10:15:21 AM
It isn't a node of a MC/ServiceGuard cluster.
The subdirectories are real subdirecories and they are all on the same filesystem.
I do all the commands as root.
Here is the correct output of the command:

integ3:/Prestito/KTE #ls -la
drwxrwxrwx   5 bvmvb      bv1to1        1024 Jan 30 17:05 .
drwxrwxrwx   5 bvmvb      bv1to1        1024 Sep 23 14:55 ..
drwxr-xr-x   2 bvmvb      bv1to1        4096 Jan 30 17:05 Acquisiti
drwxr-xr-x   2 bvmvb      bv1to1          96 Jan 30 10:32 Cancellati
drwxrwxrwx   2 bvmvb      bv1to1        5120 Jan 30 17:05 DaAcquisire
integ3:/Prestito/KTE #
0
luigi
1/30/2004 4:13:20 PM
Gigi <luigi.mazzucchetti@inwind.it> wrote:
> 
> integ3:/Prestito/KTE #ls -la
> drwxrwxrwx   5 bvmvb      bv1to1        1024 Jan 30 17:05 .
> drwxrwxrwx   5 bvmvb      bv1to1        1024 Sep 23 14:55 ..
> drwxr-xr-x   2 bvmvb      bv1to1        4096 Jan 30 17:05 Acquisiti
> drwxr-xr-x   2 bvmvb      bv1to1          96 Jan 30 10:32 Cancellati
> drwxrwxrwx   2 bvmvb      bv1to1        5120 Jan 30 17:05 DaAcquisire
> integ3:/Prestito/KTE #

If the problem reoccur cd into dir... 

ls -f
find . -type d -exec /usr/bin/ls -l {} \;

or just a find

find . -name '*'

Can you see anything? 

/sbin/ls and /usr/bin/ls having the same problem? Whats about the
underlaying filesystem, is it sufficiently patched?

Frank
-- 
"Contrary to popular belief, Unix isnt user friendly. It just
happens to be selective about who it makes friends with."
0
Frank
2/1/2004 7:12:02 PM
> If the problem reoccur cd into dir... 
> 
> ls -f
> find . -type d -exec /usr/bin/ls -l {} \;
> 
> or just a find
> 
> find . -name '*'
> 
> Can you see anything? 
> 
> /sbin/ls and /usr/bin/ls having the same problem? Whats about the
> underlaying filesystem, is it sufficiently patched?
> 
> Frank

The find command showed me only the directory I always see and did'nt
show me the others.
The problem occured with both /sbin/ls and /usr/bin/ls.

Luigi
0
luigi
2/2/2004 11:07:44 AM
Hi Gigi

 >> When you can see all files and directories, do a "ls -la" and post
 >> the output.
> integ3:/Prestito/KTE #ls -la
> drwxrwxrwx   5 bvmvb      bv1to1        1024 Jan 30 17:05 .
> drwxrwxrwx   5 bvmvb      bv1to1        1024 Sep 23 14:55 ..
> drwxr-xr-x   2 bvmvb      bv1to1        4096 Jan 30 17:05 Acquisiti
> drwxr-xr-x   2 bvmvb      bv1to1          96 Jan 30 10:32 Cancellati
> drwxrwxrwx   2 bvmvb      bv1to1        5120 Jan 30 17:05 DaAcquisire
> integ3:/Prestito/KTE #
You told us, that the subdirs "Acquisiti" and "Cancellati" are not shown 
sometimes. The first thing I see is, that the permissions are different 
to "DaAcquisire" (though this is not meaningfull for getting listings).

It would be interesting to have some informations about the contents of 
the directories. Especially I'd be interested in symbolic links inside 
these directories:

try the following:
  cd /Prestito/KTE
  find . -type l

Also interesting would be the output of the command
  mount -v
and
  ps -ef | grep auto

How does the ls -la work when the two subdirs do NOT appear: Does the 
ls-command hang or does it return immediately?

Florian

-- 
mail an "fanwander AT mnet MINUS online PUNKT de"

0
Florian
2/2/2004 2:54:02 PM
Gigi <luigi.mazzucchetti@inwind.it> wrote:
> 
> I'm in this directory: /Prestito/KTE
> I try to get the list of the content of this directory with the
> command "ll". In the list I have to see 3 directories
> (Acquisiti,Cancellati,DaAcquisire), but the command shows me only
> "DaAcquisire". I don't know why. I can't execute the command "cd
> Acquisiti" because the system doesn't see the directory. After 5
> minutes (or more or less) I try again and all is perfect. I see all
> the directories, I can enter in "Cancellati" and "Acquisiti". I can
> get a list of the content of these directories. All is correct.
> 
> Can anyone help me? I'm only 20 years old so I don't have a lot
> experience.

After reading this thread again I agree to the assumption from
Florian. This behaviour cant only be caused by the automounter. You
change into the directory, and see nothing inside, then after 5
minutes you will be able to see the directorys. 300 sec is the
default value for the automounter to wait bevor a filesystem 
get unmounted. Maybe someone has create the dirs at first, after
that the automounter was activated. Now you change into that dir
the automounter is going to serv your request and mount the
requested filesystem. Which contains just DaAcquisire, the whole dir
which contains all three directorys are under the mountpoint...

Are the contents of the directory DaAcquisire always the same even
when the other dirs get lost? Create a testfile inside DaAcquisire
ans wait until the both dirs come back. Look for your testfile is it
still there?

Check if there are any autofs or autmount processes running.
ps -efl|grep auto

Verify that the autmounter is disabled.
egrep -i "AUTOMOUNT=|AUTOFS=" /etc/rc.config.d/nfsconf
AUTOMOUNT=0
AUTOFS=0

If there is no automounter running, please provide us with the
output from mount -v 

Frank
-- 
:(){ :|:&};:
0
Frank
2/2/2004 6:34:18 PM
> Are the contents of the directory DaAcquisire always the same even
> when the other dirs get lost? Create a testfile inside DaAcquisire
> ans wait until the both dirs come back. Look for your testfile is it
> still there?
No. When the other dirs get lost all the files in this directory
disappear.
I created a testfile in this directory. When the both dirs came back
this file was still there and when the both dirs disappeared again
also this file disappeared.

> Check if there are any autofs or autmount processes running.
> ps -efl|grep auto
There are no autofs or automount processes running.

> Verify that the autmounter is disabled.
> egrep -i "AUTOMOUNT=|AUTOFS=" /etc/rc.config.d/nfsconf
> AUTOMOUNT=0
> AUTOFS=0
Automount is 0. Autofs isn't here (the default is 0?).
 
> If there is no automounter running, please provide us with the
> output from mount -v 
/dev/vg00/lvol3 on / type vxfs log on Sat Dec 20 09:44:51 2003
/dev/vg00/lvol1 on /stand type hfs defaults on Sat Dec 20 09:44:52
2003
/dev/vg00/lvol8 on /var type vxfs delaylog,nodatainlog on Sat Dec 20
09:44:57 2003
/dev/vg00/lvol7 on /usr type vxfs delaylog,nodatainlog on Sat Dec 20
09:44:57 2003
/dev/vg00/lvol4 on /tmp type vxfs delaylog,nodatainlog on Sat Dec 20
09:44:57 2003
/dev/vg00/lvoloradb3 on /oratol2 type vxfs delaylog,nodatainlog on Sat
Dec 20 09:44:57 2003
/dev/vg00/lvoloradev on /oradev type vxfs delaylog,nodatainlog on Sat
Dec 20 09:44:57 2003
/dev/vg00/lvoloradb2 on /oradb2 type vxfs delaylog,nodatainlog on Sat
Dec 20 09:44:58 2003
/dev/vg00/lvoradb on /oradb type vxfs delaylog,nodatainlog on Sat Dec
20 09:44:58 2003
/dev/vg00/lvoracle on /oracle type vxfs delaylog,nodatainlog on Sat
Dec 20 09:44:58 2003
/dev/vg00/lvol6 on /opt type vxfs delaylog,nodatainlog on Sat Dec 20
09:44:58 2003
/dev/vg00/lvolhome on /home type vxfs delaylog,nodatainlog on Sat Dec
20 09:44:58 2003
/dev/vg00/lvolgesb on /gesbank type vxfs delaylog,nodatainlog on Sat
Dec 20 09:44:58 2003
/dev/vg00/lvbv1to1_var on /bv_data type vxfs delaylog,nodatainlog on
Sat Dec 20 09:44:59 2003
0
luigi
2/3/2004 9:01:10 AM
> Are the contents of the directory DaAcquisire always the same even
> when the other dirs get lost? Create a testfile inside DaAcquisire
> ans wait until the both dirs come back. Look for your testfile is it
> still there?
No. When the other dirs get lost all the files in this directory
disappear.
I created a testfile in this directory. When the both dirs came back
this file was still there and when the both dirs disappeared again
also this file disappeared.

> Check if there are any autofs or autmount processes running.
> ps -efl|grep auto
There are no autofs or automount processes running.

> Verify that the autmounter is disabled.
> egrep -i "AUTOMOUNT=|AUTOFS=" /etc/rc.config.d/nfsconf
> AUTOMOUNT=0
> AUTOFS=0
Automount is 0. Autofs isn't here (the default is 0?).
 
> If there is no automounter running, please provide us with the
> output from mount -v 
/dev/vg00/lvol3 on / type vxfs log on Sat Dec 20 09:44:51 2003
/dev/vg00/lvol1 on /stand type hfs defaults on Sat Dec 20 09:44:52
2003
/dev/vg00/lvol8 on /var type vxfs delaylog,nodatainlog on Sat Dec 20
09:44:57 2003
/dev/vg00/lvol7 on /usr type vxfs delaylog,nodatainlog on Sat Dec 20
09:44:57 2003
/dev/vg00/lvol4 on /tmp type vxfs delaylog,nodatainlog on Sat Dec 20
09:44:57 2003
/dev/vg00/lvoloradb3 on /oratol2 type vxfs delaylog,nodatainlog on Sat
Dec 20 09:44:57 2003
/dev/vg00/lvoloradev on /oradev type vxfs delaylog,nodatainlog on Sat
Dec 20 09:44:57 2003
/dev/vg00/lvoloradb2 on /oradb2 type vxfs delaylog,nodatainlog on Sat
Dec 20 09:44:58 2003
/dev/vg00/lvoradb on /oradb type vxfs delaylog,nodatainlog on Sat Dec
20 09:44:58 2003
/dev/vg00/lvoracle on /oracle type vxfs delaylog,nodatainlog on Sat
Dec 20 09:44:58 2003
/dev/vg00/lvol6 on /opt type vxfs delaylog,nodatainlog on Sat Dec 20
09:44:58 2003
/dev/vg00/lvolhome on /home type vxfs delaylog,nodatainlog on Sat Dec
20 09:44:58 2003
/dev/vg00/lvolgesb on /gesbank type vxfs delaylog,nodatainlog on Sat
Dec 20 09:44:58 2003
/dev/vg00/lvbv1to1_var on /bv_data type vxfs delaylog,nodatainlog on
Sat Dec 20 09:44:59 2003
0
luigi
2/3/2004 9:01:16 AM
Hi Gigi

>>If there is no automounter running, please provide us with the
>>output from mount -v 
> 
> /dev/vg00/lvol3 on / type vxfs log on Sat Dec 20 09:44:51 2003
 > [...]

So appearantely /Prestito is not a mountpoint on its own, but
located in /

So what ist the output of
  # cd /
  # ls -la

And still very important is the answer to the two questions:
1.) What is the output of:
     # cd /Prestito/KTE
     # find . -type l

2.) How does the ls -la work when the two subdirs do NOT appear: Does
     the ls-command hang or does it return immediately?

Florian

-- 
mail an "fanwander AT mnet MINUS online PUNKT de"

0
Florian
2/3/2004 12:40:21 PM
> So what ist the output of
>   # cd /
>   # ls -la
drwxrwxrwx   8 bvmvb      bv1to1      259072 Feb  4 09:30 Prestito
and all the other directories

> 1.) What is the output of:
>      # cd /Prestito/KTE
>      # find . -type l
the command doesn't return aything

> 2.) How does the ls -la work when the two subdirs do NOT appear: Does
>      the ls-command hang or does it return immediately?
It return immediately.
0
luigi
2/4/2004 8:46:05 AM
Hi Gigi

>>So what ist the output of
>>  # cd /
>>  # ls -la
> 
> drwxrwxrwx   8 bvmvb      bv1to1      259072 Feb  4 09:30 Prestito
> and all the other directories
ok

>>1.) What is the output of:
>>     # cd /Prestito/KTE
>>     # find . -type l
> 
> the command doesn't return aything
ok, there are no links ot other filesystems that are not accesible at 
the moment, which could make the ls hang (and also no links to 
automounter dirs - but that we could exclude already).

>>2.) How does the ls -la work when the two subdirs do NOT appear: Does
>>     the ls-command hang or does it return immediately?
> It return immediately.
This also excludes hanging mounts.

If I believe all you wrote, then to my opinion, there is some temporary 
job (cron? application script?) that moves your directories (or changes 
the permissions, if you have the problem as standard user).


kind regards, Florian
-- 
mail an "fanwander AT mnet MINUS online PUNKT de"

0
Florian
2/4/2004 12:27:57 PM
Hi Florian.

> If I believe all you wrote, then to my opinion, there is some temporary 
> job (cron? application script?) that moves your directories (or changes 
> the permissions, if you have the problem as standard user).

I have the problem as root, not only as standard user, and there are
no temporary job that use the directories.

Thanks, 
Luigi
0
luigi
2/5/2004 7:33:02 AM
Hi Luigi

> I have the problem as root, not only as standard user, and there are
> no temporary job that use the directories.
So you should establish a job, that monitors the directories.

Read access monitoring could be done bei ls -l a dedicated file in each 
of the subdirs, that is created for.
Write access could be done by cat'ing some known contents to this file.
The output of an command like
  lsof | grep "/Prestito/KTE" > logfile
might be also interesting (lsof is not standard HPUX but available at 
the shareware sites of HP).

Create a shellscript with an loop, which does the lsof, the read test 
and the write test. If ls or cat fail, then send the lsof output as mail 
to root. It might show you who is/was accessing the directories files at 
that time.

Florian
-- 
mail an "fanwander AT mnet MINUS online PUNKT de"

0
Florian
2/5/2004 11:30:50 AM
Hi Florian.
I created this shell script:

a=0
while [ $a -eq 0 ]
do
ls -l /Prestito/KTE/pippo
if [ $? -ne 0 ]; then
 lsof | grep "/Prestito/KTE" | mailx -s `hostname` $email
fi
echo "Test" > /home/bvmvb/Release/xml/Prestito/WebBank/KTE/Acquisiti/pippo
if [ $? -ne 0 ]; then
 lsof | grep "/Prestito/KTE" | mailx -s `hostname` $email
fi
sleep 60
done

Now I'm going to execute it during the night. Tomorrow I'll see the
results and I'll write in this post the reponses of the command lsof.
0
luigi
2/5/2004 4:24:04 PM
Hi Florian.
The first time the script got wrong it doesn't return me anything
(there was no processes using the directory /Prestito/KTE). I'll see
next messages.
Bye,
Luigi
0
luigi
2/5/2004 4:33:26 PM
> Hi Florian.
> The first time the script got wrong it doesn't return me anything
> (there was no processes using the directory /Prestito/KTE). I'll see
> next messages.
> Bye,
> Luigi

Hi Florian.
The script sent me many messages this night. All of these was empty.
Lsof didn't return anything when directories disappear.
Best regards,
Luigi
0
luigi
2/6/2004 8:54:44 AM
Hi

There is something that is astonishing me:
> echo "Test" > /home/bvmvb/Release/xml/Prestito/WebBank/KTE/Acquisiti/pippo
Is this the real directory???? You always wrote about a directory 
/Prestito/KTE/...

Could it be that this is a link in your home directory to the real 
directory?
Are you sitting in front of the real machine or are you sitting at a 
workstation which has mounted your homedirectory from somewhere else via 
automounter....?

To me it looks that your problem is not a problem at the real machine, 
but a kind of "displaying" problem at your workstation.


Florian

0
Florian
2/6/2004 10:09:25 AM
Hi Florian.
I always wrote "/Prestito/KTE" to hide the real directory name
/home/bvmvb/Release/xml/Prestito/WebBank/KTE/Acquisiti. I always
changed this directory with "/Prestito/KTE" (
it is a false directory name, it doesn't exist). So in the "wrong
post" I forgot to change also that name. There are no link or other
things.

Luigi
0
luigi
2/10/2004 7:26:17 AM
Reply: