From: Sergio Rivera Villarreal <serriver () ccr ! dsi ! uanl ! mx>
To: tru64-unix-managers
Subject: SUMMARY: Files unlinked ?
Date: Mon, 26 Jul 1999 18:30:17 +0000 [thread overview]
Message-ID: <96079058316065.tru64-unix-managers.marc@archive.invalid> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: multipart/mixed; boundary="--Boundary_(ID_Sts5Hqdbe8asZzQ6z3eblg)", Size: 12343 bytes --]
This is a multi-part message in MIME format.
--Boundary_(ID_Sts5Hqdbe8asZzQ6z3eblg)
Content-type: MULTIPART/ALTERNATIVE;
BOUNDARY="Boundary_(ID_gc4aANiS7Xw3naS1o+emAQ)"
--Boundary_(ID_gc4aANiS7Xw3naS1o+emAQ)
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 8BIT
Many thanks to Mr. Lars Bro for his advices ...
The original message :
We have an AS-800, DU4.0D with PK 3
Somebody knows a way to identify a unlinked file in D-Unix, we
tried with the fuser and the lsof commands but we didn�t get
nothing...
Conclusion:
lsof and fuser can tell you that anonumous resources are in use on
that
filesystem.
Not the name it had - which - I'm afraid would be against the very
definition.
When I enter these commands, I open file "fil" for read on descriptor 7:
$ exec 7<fil
$ echo $$
6584
$
lsof shows the following:
#lsof | grep 6584
sh 6584 lbr cwd VDIR 2506, 707405 8192 14751
/usr/users/lbr
sh 6584 lbr txt VREG 2506, 707405 131072 370
/usr/bin/sh
sh 6584 lbr txt VREG 8, 0 131072 10987
/sbin/loader
sh 6584 lbr txt VREG 8, 0 1634400 28505
/shlib/libc.so
sh 6584 lbr 0u VCHR 6, 3 0t128 6548
/dev/pts/3
sh 6584 lbr 1u VCHR 6, 3 0t128 6548
/dev/pts/3
sh 6584 lbr 2u VCHR 6, 3 0t128 6548
/dev/pts/3
sh 6584 lbr 7r VREG 2506, 707405 0 14351
/usr/users/lbr/fil
When I remove the file:
# lsof | grep 6584
sh 6584 lbr cwd VDIR 2506, 707405 8192 14751
/usr/users/lbr
sh 6584 lbr txt VREG 2506, 707405 131072 370
/usr/bin/sh
sh 6584 lbr txt VREG 8, 0 131072 10987
/sbin/loader
sh 6584 lbr txt VREG 8, 0 1634400 28505
/shlib/libc.so
sh 6584 lbr 0u VCHR 6, 3 0t140 6548
/dev/pts/3
sh 6584 lbr 1u VCHR 6, 3 0t140 6548
/dev/pts/3
sh 6584 lbr 2u VCHR 6, 3 0t140 6548
/dev/pts/3
sh 6584 lbr 7r VREG 2506, 707405 0 14351
/usr
(usr_domain#usr)
lsof shows that the process still has something and that something is
allocated by fileset usr on domain usr_domain.
The command fuser(8) is also able to find the process.
# fuser -c /usr
"unlink a file" is exactly to "remove the relation between the inode and
the
file name". So it would be against the definition if we could find the
name
after unlink. I tried with tag2name, the advfs command that converts an
advfs-inode to a filename:
# /sbin/advfs/tag2name /usr/.tags/14351
/usr/users/lbr/fil
$ rm fil
# /sbin/advfs/tag2name /usr/.tags/14351
tag2name: statfs(/usr/.tags/14351) error; [2] No such file or directory
#
Which correctly tells you that there is no name for that tag any more.
Note that there is a change in fuser(2) between 4.0E and 4.0F
man 2 fuser From 4.0E:
PARAMETERS
file Specifies the file name.
flag Specifies one of the following values. If none of the
following
are
values are specified, the default is to match open files.
F_FILE_ONLY Matches only file ids.
F_CONTAINED Provides mount point matching.
fuser_array Specifies the array.
man 2 fuser from 4.0F:
PARAMETERS
file Specifies the file name.
flag Specifies one of the following values. If none of the
following
are
values are specified, the default is to match open files.
F_FILE_ONLY Matches only file ids.
F_CONTAINED Provides mount point matching.
*** F_NOLINK Matches deleted files on the mount point
specified by file.
fuser_array Specifies the array.
Whatever F_NOLINK actually means, I think that this option will give you
the
ID's of processes that have done the 'delete' trick.
--Boundary_(ID_gc4aANiS7Xw3naS1o+emAQ)
Content-type: text/html; charset=us-ascii
Content-transfer-encoding: 7BIT
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Many thanks to Mr. Lars Bro for his advices ...
<br><u>The original message :</u>
<blockquote> We have an AS-800, DU4.0D with PK
3
<br>Somebody knows a way to identify a unlinked file in D-Unix, we tried
with the fuser and the lsof commands but we didn´t get nothing...</blockquote>
<p><br><u>Conclusion:</u>
<br> lsof and fuser can tell you that anonumous
resources are in use on that
<br>filesystem.
<br> Not the name it had - which - I'm afraid would
be against the very
<br>definition.
<p>When I enter these commands, I open file "fil" for read on descriptor
7:
<br>$ exec 7<fil
<br>$ echo $$
<br>6584
<br>$
<p>lsof shows the following:
<p>#lsof | grep 6584
<br>sh 6584
lbr cwd VDIR 2506, 707405
8192 14751
<br>/usr/users/lbr
<br>sh 6584
lbr txt VREG 2506, 707405 131072
370
<br>/usr/bin/sh
<br>sh 6584
lbr txt VREG 8,
0 131072 10987
<br>/sbin/loader
<br>sh 6584
lbr txt VREG 8,
0 1634400 28505
<br>/shlib/libc.so
<br>sh 6584
lbr 0u VCHR 6,
3 0t128
6548
<br>/dev/pts/3
<br>sh 6584
lbr 1u VCHR 6,
3 0t128
6548
<br>/dev/pts/3
<br>sh 6584
lbr 2u VCHR 6,
3 0t128
6548
<br>/dev/pts/3
<br>sh 6584
lbr 7r VREG 2506, 707405
0 14351
<br>/usr/users/lbr/fil
<p>When I remove the file:
<p># lsof | grep 6584
<br>sh 6584
lbr cwd VDIR 2506, 707405
8192 14751
<br>/usr/users/lbr
<br>sh 6584
lbr txt VREG 2506, 707405 131072
370
<br>/usr/bin/sh
<br>sh 6584
lbr txt VREG 8,
0 131072 10987
<br>/sbin/loader
<br>sh 6584
lbr txt VREG 8,
0 1634400 28505
<br>/shlib/libc.so
<br>sh 6584
lbr 0u VCHR 6,
3 0t140
6548
<br>/dev/pts/3
<br>sh 6584
lbr 1u VCHR 6,
3 0t140
6548
<br>/dev/pts/3
<br>sh 6584
lbr 2u VCHR 6,
3 0t140
6548
<br>/dev/pts/3
<br>sh 6584
lbr 7r VREG 2506, 707405
0 14351 /usr
<br>(usr_domain#usr)
<p>lsof shows that the process still has something and that something is
<br>allocated by fileset usr on domain usr_domain.
<p>The command fuser(8) is also able to find the process.
<p># fuser -c /usr
<p>"unlink a file" is exactly to "remove the relation between the inode
and the
<br>file name". So it would be against the definition if we could find
the name
<br>after unlink. I tried with tag2name, the advfs command that converts
an
<br>advfs-inode to a filename:
<p># /sbin/advfs/tag2name /usr/.tags/14351
<br>/usr/users/lbr/fil
<p>$ rm fil
<p># /sbin/advfs/tag2name /usr/.tags/14351
<br>tag2name: statfs(/usr/.tags/14351) error; [2] No such file or directory
<br>#
<p>Which correctly tells you that there is no name for that tag any more.
<p>Note that there is a change in fuser(2) between 4.0E and 4.0F
<p>man 2 fuser From 4.0E:
<p>PARAMETERS
<br> file Specifies the file name.
<br> flag Specifies one of the following
values. If none of the following
<br>are
<br>
values are specified, the default is to match open files.
<br>
F_FILE_ONLY Matches only
file ids.
<br>
F_CONTAINED Provides mount
point matching.
<p>fuser_array Specifies the array.
<p>man 2 fuser from 4.0F:
<p>PARAMETERS
<br> file Specifies the file name.
<br> flag Specifies one of the following
values. If none of the following
<br>are
<br>
values are specified, the default is to match open files.
<br>
F_FILE_ONLY Matches only
file ids.
<br>
F_CONTAINED Provides mount
point matching.
<br>*** F_NOLINK
Matches deleted files on the mount point
<br>specified by file.
<br>fuser_array Specifies the array.
<p>Whatever F_NOLINK actually means, I think that this option will give
you the
<br>ID's of processes that have done the 'delete' trick.
<br>
<br> </html>
--Boundary_(ID_gc4aANiS7Xw3naS1o+emAQ)--
--Boundary_(ID_Sts5Hqdbe8asZzQ6z3eblg)
Content-type: text/x-vcard; name=serriver.vcf; charset=us-ascii
Content-description: Card for Sergio Rivera Villarreal
Content-disposition: attachment; filename=serriver.vcf
Content-transfer-encoding: 7BIT
begin:vcard
n:Rivera Villarreal;Sergio
tel;pager:(151-11-11) 57458
tel;cell:n/a
tel;fax:329-40-83
tel;home:384-01-61
tel;work:329-40-81
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:serriver@ccr.dsi.uanl.mx
fn:Sergio Rivera Villarreal
end:vcard
--Boundary_(ID_Sts5Hqdbe8asZzQ6z3eblg)--
reply other threads:[~1999-07-26 18:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox