Tuesday, March 3, 2009

How to undelete any open, deleted file on linux / solaris

Wow, I like that:

Chris Dew wrote up a neat trick on how to recover files if deleted on Linux, yet still open by a process.

This works on Solaris as well.  =)

$:~:uname -a
SunOS somehost.com 5.10 Generic_127112-11 i86pc i386 i86pc

$:~:echo “sup prefetch.net folks?” > testfile
$:~:tail -f testfile &
[1] 17134

$:~:rm testfile
$:~:ls /proc/17134/fd/
0  1  2
$:~:cat /proc/17134/fd/0
sup prefetch.net folks?
$:~:cp !$ ./testfile
cp /proc/17134/fd/0 ./testfile
$:~:cat testfile
sup prefetch.net folks?

Again, it’s from the awsome: http://prefetch.net/blog/index.php/2009/02/25/how-to-undelete-any-open-deleted-file-on-linux-solaris/

blog comments powered by Disqus