How to recover open but deleted file on Linux using ln instead of cp?

Try using tail to copy the file continually:

tail -c +0 -f /proc/$pid/fd/$fd > filename

Of course, you will have to stop the tail process by hand (or some other external means) when the download has finished.


The fdlink project, consisting of a Linux kernel module and simple application, purports to create a new link to an open file descriptor. I haven't tried it.


This will get the job done, though not through by recovering the inode:

cp /proc/$PID/fd/$FD /tmp/blah
kill $PID
wget -c $URL -O /tmp/blah

Or just manually stop the download in Chrome if you don't want to kill the whole browser.