From owner-freebsd-questions@FreeBSD.ORG Sun Oct 19 02:41:01 2008 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 8E8EB106568C for ; Sun, 19 Oct 2008 02:41:01 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 2576B8FC08 for ; Sun, 19 Oct 2008 02:41:00 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r55.edvax.de (port-92-195-41-11.dynamic.qsc.de [92.195.41.11]) by mx02.qsc.de (Postfix) with ESMTP id 7243116C0209 for ; Sun, 19 Oct 2008 04:40:59 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id m9J2ew2G008606 for ; Sun, 19 Oct 2008 04:40:58 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sun, 19 Oct 2008 04:40:58 +0200 From: Polytropon To: "freebsd-questions@freebsd.org" Message-Id: <20081019044058.9ff31b6f.freebsd@edvax.de> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Inode numbering X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 02:41:01 -0000 Hi! Because I didn't find sufficient informations and "try and error" would be incomplete (and insecure regarding the result), I'd like to ask the following question: Let's assume we have a directory D with an inode number i(D). It contains a file F with its inode number i(F). May I state that i(D) < i(F)? I need to ask this in order to solve my data loss problem: I will need to write a inode recovery program (having iintensive looks at fsck_ffs' and fsdb's source code) to iterate over all the inodes. Maybe this additional question can be answered: Is there a mechanism that output inode numbers according to a certain algorithm, or is it random? If I would try to check every imaginable inode nummer according to the states "connected", "not connected - orphan" or "not connec- ted - not used", could I iterate from 1 to the maximum of the type ino_t, which is __uint32_t? My idea is to "trace back" orphaned inodes by "brute force" because fsck_ffs doesn't do the job, but similar to fsck_ffs, they will be reconnected to the directory they originally have been gnereated in, or in a kind of lost+found directory when the information from the respective superstructure (e. g. file names) are lost. I may assume that at least the inode of my former home directory has gone away, so if everything else is still there (I have some evidences from fsdb to assume this), after reconnecting everything should be accessible. Only the file names from the first hierarchy level (the files and subdirs directly within the home directory) would change into #123456 as you know it from fsck_ffs' lost+found, but the content inside the subdirs should still be present with the original filenames - assumed that the corresonding inode information structures are still complete. Thanks for comments! And please tell me if there's already a tool that does this! :-) -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...