From owner-freebsd-questions@FreeBSD.ORG Mon Dec 8 21:52:55 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FF8D16A4CE for ; Mon, 8 Dec 2003 21:52:55 -0800 (PST) Received: from web41110.mail.yahoo.com (web41110.mail.yahoo.com [66.218.93.26]) by mx1.FreeBSD.org (Postfix) with SMTP id 730B043D25 for ; Mon, 8 Dec 2003 21:52:54 -0800 (PST) (envelope-from scott@sremick.net) Message-ID: <20031209055254.43869.qmail@web41110.mail.yahoo.com> Received: from [24.48.174.124] by web41110.mail.yahoo.com via HTTP; Mon, 08 Dec 2003 21:52:54 PST X-RocketYMMF: siremick Date: Mon, 8 Dec 2003 21:52:54 -0800 (PST) From: "Scott I. Remick" To: FreeBSD In-Reply-To: <20031205135430.6252d368.doublef@tele-kom.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: "Cannot find file system superblock" error - how to recover? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: scott@sremick.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2003 05:52:55 -0000 --- Sergey 'DoubleF' Zaharchenko wrote: > I wonder what did destroy it. Of course, system crashes can do wonders, > but... Well, I was trying to save a file to that drive when my system spontaneously rebooted for no apparent reason. > In fact, there should be a way, because a valid superblock copy has a > correct checksum. Perhaps I'll hack up a program to do that taking > information from the /usr/src/sys/ufs/... There's also a magic number > for a superblock, mentioned in fs.h (in 4.8 it's 0x011954). I see: #define FS_UFS1_MAGIC 0x011954 /* UFS1 fast filesystem magic number */ #define FS_UFS2_MAGIC 0x19540119 /* UFS2 fast filesystem magic number */ And I remember this drive was UFS2, because I was wondering if I should be concerned that this drive was UFS2 and the system drive was UFS1 (/, /var, /usr). However, the following command turns up no results after several mins: su-2.05b# hd < /dev/ad6s1 | grep "19 01 54 19" Yet this won't work unless the bytes all line up on the same line. If they're split across lines in the hd output, there'll be no match. Even though your command is for UFS1, I get several matches, but they must be false-positives as I know I used UFS2: su-2.05b# hd < /dev/ad6s1 | grep "54 19 01 00" 00001620 54 19 01 00 74 10 68 81 23 00 00 e8 d5 03 00 00 |T...t.h.#.......| 00002550 01 00 00 00 00 00 00 00 00 00 00 00 54 19 01 00 |............T...| 00004550 01 00 00 00 00 00 00 00 00 00 00 00 54 19 01 00 |............T...| 002e6550 01 00 00 00 00 00 00 00 00 00 00 00 54 19 01 00 |............T...| 00548740 51 19 01 00 52 19 01 00 53 19 01 00 54 19 01 00 |Q...R...S...T...| 00549740 51 19 01 00 52 19 01 00 53 19 01 00 54 19 01 00 |Q...R...S...T...| Unless somehow I am confused...? Any other ideas for finding an intact superblock off this drive and repairing it? Anyone? ===== Scott I. Remick --==-- ICQ: 450152 Save the internet - Use a Mozilla-based browser: http://vtbsd.net/mozilla/ FreeBSD: Because making unix user-friendly is easier than debugging Windows. http://vtbsd.net/freebsd/ "Voici mon secret. Il est tres simple: on ne voit bien qu'avec le coeur. L'essentiel est invisible pour les yeux." Q: Because it reverses the logical flow of conversation. A: Why is putting a reply at the top of the message frowned upon?