NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Reconnect open file without a name to file system (was: Re: Free space inconsistency with df / du)



Christos Zoulas wrote:

> Or you can undelete it by finding it in /proc/<pid>/fd/<n> and linking
> it back to the original filesystem :-)

Thanks Christos, this is really a cool tip.

  $ echo foo > bar
  $ sleep 300 < bar &
  [1] 25291
  $ ls -i bar
  315468 bar
  $ rm bar
  $ ls bar
  ls: bar: No such file or directory
  $ ls -1i /proc/25291/fd/
  315468 0
   46359 1
   46359 2
  $ ln /proc/25291/fd/0 bar2
  $ ls -i bar*
  315468 bar2
  $ cat bar2
  foo

ciao
     Klaus




Home | Main Index | Thread Index | Old Index