Hi Mike,

thanks a lot for your kind reply !!!

> I don't use dtrace for this - I use find.  For example:
>
> # find /proc/*/fd -type f -links 0 \! -size 0 -ls | sort -n +1
      this will list the inode number, but does not tell the file name, use ps
to list
      and check the pid cost a lot of time.

      so I'd like to write one line dtrace script to get all the pids who
still reference
      those deleted files

> You can view the (e.g) log file with commands like:
>
> # tail -f /proc/<pid>/fd/<fd>
      most of the time we do not know the pid and the file name.
>
> If you find that there is a process that you can't kill that has a
> huge file, you can truncate it with:
>
> # cp /dev/null /proc/<pid>/fd/<fd>
>
> Be sure you have the right one.  See the tail command above.
>

Thanks,

James Yang
Global Unix Support,  IES,  GTO
Deutsche Bank US
Phone:   201-593-1360
Email :   [EMAIL PROTECTED]
Pager :  1-800-946-4646  PIN# 6105618
CR: NYC_UNIX_ES_US_UNIX_SUPPORT
http://dcsupport.ies.gto.intranet.db.com/


"Mike Gerdts" <[EMAIL PROTECTED]> wrote on 09/20/2008 08:43:49 PM:

> On Sat, Sep 20, 2008 at 4:19 PM, Jianhua Yang <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > file system was filled up and files were deleled by someone while there
> > still had processes referencing those deleted files,
> > the disk space was not released, the result of du was different from
output
> > of df.
> > now how to use dtrace to find the pids that were still referencing those
> > deleted files ?
>
> I don't use dtrace for this - I use find.  For example:
>
> # find /proc/*/fd -type f -links 0 \! -size 0 -ls | sort -n +1
>
> You can view the (e.g) log file with commands like:
>
> # tail -f /proc/<pid>/fd/<fd>
>
> If you find that there is a process that you can't kill that has a
> huge file, you can truncate it with:
>
> # cp /dev/null /proc/<pid>/fd/<fd>
>
> Be sure you have the right one.  See the tail command above.
>
> --
> Mike Gerdts
> http://mgerdts.blogspot.com/

---

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to