[PLUG] Creating a filename for an open, but deleted, file

Russell Senior russell at personaltelco.net
Fri Nov 14 05:06:43 UTC 2014


>>>>> "Russell" == Russell Senior <russell at personaltelco.net> writes:

>>>>> "Robert" == Robert Citek <robert.citek at gmail.com> writes:
Robert> Greetings all, For a file that is open, but deleted, is there
Robert> a way to create a new filename for it given either the file
Robert> descriptor from the process or the inode?

Robert> Thus far, my Google searches suggest the answer is "no".  But
Robert> I find that hard to believe.

Russell> Check out debugfs or maybe one of the other tools in
Russell> e2fsprogs package.  This is assuming the filesystem is an
Russell> ext2/3/4.

Russell> As long as the process doesn't let go of the inode, the
Russell> storage won't be reclaimed.

Read the debugfs manpage.  Particularly, look for:

         ln filespec dest_file
              Create a link named dest_file which is a hard link to
              filespec.  Note this does not adjust the inode reference
              counts.

The 'filespec' would be the inode number, I think.


-- 
Russell Senior, President
russell at personaltelco.net



More information about the PLUG mailing list