From owner-freebsd-hackers Mon Oct 27 23:33:20 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id XAA03554 for hackers-outgoing; Mon, 27 Oct 1997 23:33:20 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from safeconcept.utimaco.co.at (mail-gw.utimaco.co.at [195.96.28.162]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id XAA03543 for ; Mon, 27 Oct 1997 23:33:15 -0800 (PST) (envelope-from Michael.Schuster@utimaco.co.at) Received: (from uucp@localhost) by safeconcept.utimaco.co.at (8.8.5/8.8.5) id IAA11117 for ; Tue, 28 Oct 1997 08:22:26 +0100 (CET) Received: from wshpux.utimaco.co.at(10.0.0.18) by safeconcept via smap (V2.0) id xma011114; Tue, 28 Oct 97 08:22:08 +0100 Message-ID: <345594A5.F3E0C8BA@utimaco.co.at> Date: Tue, 28 Oct 1997 08:30:45 +0100 From: Michael Schuster Organization: Utimaco Safe Concept GmbH., Linz, Austria X-Mailer: Mozilla 4.03 [de] (X11; I; HP-UX B.10.01 9000/715) MIME-Version: 1.0 To: "hackers@FreeBSD.ORG" Subject: Re: Recovering Lost Inode? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk James Buszard-Welcher wrote: >... (we now enter the theoretical zone) > *could* I have been able to use somekindof Norton's Utilities-esque > package for UNIX which could check inodes and look for ones that > were 'file starters', and maybe check the that if all of the inodes > pointed to by that starter inode (it was big file so I excect > a level or two of inode redirection) were still intact it could > pull it back? Kinda like an 'un-delete' fsck? Ever hear of > such a thing? >From my scanty knowledge of Unix File systems, there's a slight correction necessary here: Any inode is "starter" inode; what's referred to by the indirect pointers (sorry if the name isn't the correct one) are data blocks containing pointers to data blocks which in turn contain either "real" data or again pointers to other data blocks (depending on whether they're pointed at by single, double or triple [are they used in FreeBSD?] redirection pointers in the inode); they don't contain any inode specific things (like permission bits, etc.). Another thing: inodes are reused as soon as they are freed (I don't know by what policy - any pointers where to look?). So finding an "intact" inode needn't mean that that's the file you need. Interpreting arbitrary free data blocks as "pointed to by indirection pointers" in order to reconstruct a deleted file is probably a very hard problem. Putting aside the high probability that one of the file blocks (not the inode) will be reused as soon as the file is rm'ed (you're in a multitasking environment, remember), the question remains whether freed data blocks are cleared or, in the case of inodes, marked as freed/unused (they're in a list of freed inodes, aren't they?). So, back to your question: you could alias/rewrite /bin/rm to mv your file to /saved/files/here and have a cron script deleting files in there older than a week, e.g. Just my 2 bits. Any corrections/updates/etc. very welcome!! Michael -- Michael Schuster Utimaco Safe Concept GmbH. | Tel: +43 732 655755 41 Europaplatz 6 | Fax: +43 732 655755 5 A-4020 Linz Austria | email: Michael.Schuster@utimaco.co.at