Date: Fri, 27 Nov 2015 22:03:53 -0500 From: "Mikhail T." <mi+thun@aldan.algebra.com> To: "alex.burlyga.ietf alex.burlyga.ietf" <alex.burlyga.ietf@gmail.com> Cc: freebsd-fs <freebsd-fs@freebsd.org> Subject: Re: Recovering an unlink-ed, but still opened file Message-ID: <56591999.1040001@aldan.algebra.com> In-Reply-To: <CA%2BJhTNQh2CKwuEsKcc0v=G=0zG4a5JQTYO56bXv%2B3MmZ8=MVDg@mail.gmail.com> References: <5658E498.9070700@aldan.algebra.com> <CA%2BJhTNQh2CKwuEsKcc0v=G=0zG4a5JQTYO56bXv%2B3MmZ8=MVDg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 27.11.2015 21:46, alex.burlyga.ietf alex.burlyga.ietf wrote:
>
> If you know which process and which file descriptor, should be able to
> just copy from /proc/<pid>/fd/<fd> to a file. I would try that first.
>
I know this trick -- and even used it on Solaris once. It may work on
Linux too. But not on FreeBSD:
tail -f /var/log/messages > /var/tmp/l &
[1] 13954
mi@narawntapu:/usr/src (829) rm /var/tmp/l
mi@narawntapu:/usr/src (830) ls -l /proc/13954/fd
ls: /proc/13954/fd: No such file or directory
Worse, our linprocfs does not support that either:
mi@narawntapu:/usr/src (831) ls -l /compat/linux/proc/13954/fd
lr--r--r-- 1 mi wheel 0 27 лис 22:00 /compat/linux/proc/13954/fd
-> *unknown*
Perhaps more importantly, even if the trick worked, it wouldn't have
been, what I asked for -- it would've allowed me to create a copy of the
file. I'd like to be able to restore access to the original -- so that,
for example, whatever the process writes to it is still available, etc.
Can that be done somehow? Thanks! Yours,
-mi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56591999.1040001>
