From owner-freebsd-fs@freebsd.org Sat Nov 28 03:30: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 D1968A39CD4 for ; Sat, 28 Nov 2015 03:30:22 +0000 (UTC) (envelope-from alex.burlyga.ietf@gmail.com) Received: from mail-vk0-x22b.google.com (mail-vk0-x22b.google.com [IPv6:2607:f8b0:400c:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89DE517F6 for ; Sat, 28 Nov 2015 03:30:22 +0000 (UTC) (envelope-from alex.burlyga.ietf@gmail.com) Received: by vkay187 with SMTP id y187so76781263vka.3 for ; Fri, 27 Nov 2015 19:30:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=H49mACP1gojftMr2L3QjAEtHtrTMn79L/KcHCVNcaBM=; b=vLeh75dFfVys3BcVI5kJtp8CrW5n5STaZ9F8uE0d52gMXIIBQ1Z2SVaCNRDmOI+v6h 2bpkJC1+sjC8Bsv2Dv7sVV5P2E/blg3cL0S9/Qiszwmddh0Zns+Hcg4ml67AKnRsN9jf GL5MVxanUe8NhRe1vTuT0QGOZKgz5b0hTUU7enBrp9vo8sPkvQ/iE9pBHRFcE7jB+vj/ 2PXWXlksafJiU4aIGp3ay82WvJZC0KYSuh4oi7iLAOyziTCuxYmTOQkUaDGg3QfBBKs3 a19oSjjNGo8zh/J2vIacasreWPQSk6DgWXj91UTXi+3ygZeSlc3tv5l2o1LzdEP+ccHx j0fA== MIME-Version: 1.0 X-Received: by 10.31.194.201 with SMTP id s192mr45658102vkf.92.1448681421691; Fri, 27 Nov 2015 19:30:21 -0800 (PST) Received: by 10.103.108.3 with HTTP; Fri, 27 Nov 2015 19:30:21 -0800 (PST) Received: by 10.103.108.3 with HTTP; Fri, 27 Nov 2015 19:30:21 -0800 (PST) In-Reply-To: <56591999.1040001@aldan.algebra.com> References: <5658E498.9070700@aldan.algebra.com> <56591999.1040001@aldan.algebra.com> Date: Fri, 27 Nov 2015 19:30:21 -0800 Message-ID: Subject: Re: Recovering an unlink-ed, but still opened file From: "alex.burlyga.ietf alex.burlyga.ietf" To: "Mikhail T." Cc: freebsd-fs Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 03:30:22 -0000 fdescfs is no use here to:-( Is the file on NFS mount by any chance? Then there is .nfsXXXXX files. Alex. On Nov 27, 2015 19:03, "Mikhail T." wrote: > 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 =D0=BB=D0=B8=D1=81 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 > > >