Recover open but deleted file on Linux using ln instead of cp

Posted by Yang on Super User See other posts from Super User or by Yang
Published on 2011-02-16T11:58:41Z Indexed on 2011/03/14 16:14 UTC
Read the original article Hit count: 314

Filed under:
|
|
|
|

Say I have a file that's downloading (from a source that's hard to re-download from), but accidentally deleted from the filesystem namespace (/tmp/blah), and I'd like to recover this file. Normally I could just cp /proc/$PID/fd/$FD /tmp/blah, but in this case that would only get me a partial snapshot, since the file is still downloading. Furthermore, once the download completes, the downloading process (e.g. Chrome) will close the FD. Any way to recover by inode/create a hard link? Any other solutions? If it makes any difference, I'm mainly concerned with ext4. Thanks in advance.

© Super User or respective owner

Related posts about linux

Related posts about file