From owner-freebsd-fs@freebsd.org Sat Nov 28 04:04:22 2015 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38A17A3A323 for ; Sat, 28 Nov 2015 04:04:22 +0000 (UTC) (envelope-from mi+thun@aldan.algebra.com) Received: from vms173007pub.verizon.net (vms173007pub.verizon.net [206.46.173.7]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CAC714C0 for ; Sat, 28 Nov 2015 04:04:21 +0000 (UTC) (envelope-from mi+thun@aldan.algebra.com) MIME-version: 1.0 Received: from [192.168.1.8] ([100.1.236.52]) by vms173007.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0NYI007LZ8IHY230@vms173007.mailsrvcs.net> for freebsd-fs@freebsd.org; Fri, 27 Nov 2015 21:03:55 -0600 (CST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=MtGvkDue c=1 sm=1 tr=0 a=UorMnhrCY2jH/mPejITChw==:117 a=LaogzpLLAAAA:8 a=oR5dmqMzAAAA:8 a=qtqOOiqGOCEA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=OLdxXjmIuasWO8Qz8K8A:9 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=aca3njQzIMUgqc5ctrQA:9 a=QJ9RKmk9sE7axZcg:21 a=_W_S_7VecoQA:10 Subject: Re: Recovering an unlink-ed, but still opened file To: "alex.burlyga.ietf alex.burlyga.ietf" References: <5658E498.9070700@aldan.algebra.com> Cc: freebsd-fs From: "Mikhail T." X-Enigmail-Draft-Status: N1110 Message-id: <56591999.1040001@aldan.algebra.com> Date: Fri, 27 Nov 2015 22:03:53 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-reply-to: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2015 04:04:22 -0000 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//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