From owner-freebsd-questions@FreeBSD.ORG Thu Aug 19 19:09:34 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22C59106566C for ; Thu, 19 Aug 2010 19:09:34 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id D62088FC15 for ; Thu, 19 Aug 2010 19:09:33 +0000 (UTC) Received: by qwg5 with SMTP id 5so2325117qwg.13 for ; Thu, 19 Aug 2010 12:09:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.1.193 with SMTP id 1mr164097qcg.290.1282244973057; Thu, 19 Aug 2010 12:09:33 -0700 (PDT) Received: by 10.229.95.145 with HTTP; Thu, 19 Aug 2010 12:09:32 -0700 (PDT) X-Originating-IP: [93.203.58.222] In-Reply-To: References: Date: Thu, 19 Aug 2010 21:09:32 +0200 Message-ID: From: "C. P. Ghost" To: EforeZZ Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions Subject: Re: How to restore a text file from UFS?? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2010 19:09:34 -0000 On Thu, Aug 19, 2010 at 8:07 PM, EforeZZ wrote: > I edited my 50Kb /etc/rc.conf, loaded a driver and.... got a kernel panic!! > After reboot my /etc/rc.conf is 0 bytes (after automatic background fsck). > Which tool should I try now to restore any version of my rc.conf?.. > I think data should still be somewhere on the disk.... 1. Have you looked into /lost+found ? 2. You could try to grep the raw device of the root partition, searching for known fragments of the old /etc/rc.conf, and then manually recreate it. But do this fast, before the now freed blocks are reused and thus overwritten again. You do have a small separate / partition, right? Better run the system with / mounted read-only, until you can find the deleted fragments. > ;-( -cpghost. -- Cordula's Web. http://www.cordula.ws/