From owner-freebsd-questions Thu Dec 30 14:18:48 1999 Delivered-To: freebsd-questions@freebsd.org Received: from dorifer.heim3.tu-clausthal.de (dorifer.heim3.tu-clausthal.de [139.174.243.252]) by hub.freebsd.org (Postfix) with ESMTP id 2A2BB1547D for ; Thu, 30 Dec 1999 14:18:40 -0800 (PST) (envelope-from olli@dorifer.heim3.tu-clausthal.de) Received: (from olli@localhost) by dorifer.heim3.tu-clausthal.de (8.8.8/8.8.8) id XAA23739; Thu, 30 Dec 1999 23:18:37 +0100 (CET) (envelope-from olli) Date: Thu, 30 Dec 1999 23:18:37 +0100 (CET) From: Oliver Fromme Message-Id: <199912302218.XAA23739@dorifer.heim3.tu-clausthal.de> To: cjclark@home.com Subject: Re: Recovering "Deleted" File Cc: freebsd-questions@freebsd.org Organization: Administration TU Clausthal Reply-To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: TIN [version 1.2 RZTUC(3) PL2] Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Crist J. Clark wrote in list.freebsd-questions: > I forgot to mention this in my initial mail, but I think there should > be a very "safe" way to do all of this. Yes, of course there is a safe way. Use tar, restore, cpio or whatever to recover the file from your backup. :-) > There really is no reason to > save the exact same bits that are there now on the disk. I'd be > perfectly happy to just copy the "deleted" file into a fresh new file, > then let the old one disappear when I close the program. Once you rm the last directory entry that references the inode (i.e. the link counter of the inode is zero), there is no file anymore. There's only an orphaned inode. You can only copy files, not inodes, so you first have to "fake" a new entry for that inode to create a file. As far as I know, fsdb is the only way to do this (and this is only a "hack", of course, it is not supposed to be a clean way to recover files). Regards Oliver -- Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany (Info: finger userinfo:olli@dorifer.heim3.tu-clausthal.de) "In jedem Stück Kohle wartet ein Diamant auf seine Geburt" (Terry Pratchett) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message