Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Dec 2003 15:11:43 +0300
From:      Sergey 'DoubleF' Zaharchenko <doublef@tele-kom.ru>
To:        scott@sremick.net
Cc:        FreeBSD <freebsd-questions@freebsd.org>
Subject:   Re: "Cannot find file system superblock" error - how to recover?
Message-ID:  <20031209151143.0c1504c3.doublef@tele-kom.ru>
In-Reply-To: <20031209055254.43869.qmail@web41110.mail.yahoo.com>
References:  <20031205135430.6252d368.doublef@tele-kom.ru> <20031209055254.43869.qmail@web41110.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--Signature=_Tue__9_Dec_2003_15_11_43_+0300_N2nklNd9u0/d.kbb
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

On Mon, 8 Dec 2003 21:52:54 -0800 (PST)
"Scott I. Remick" <scott@sremick.net> probably wrote:

> 
> --- Sergey 'DoubleF' Zaharchenko <doublef@tele-kom.ru> 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.

True, but thanks to the position of the magic number in the superblock
(I don't think it changed in 5.x) , it never crosses a line boundary.

> 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.#.......|

These:

> 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 

DON'T look like false positives. They're just what you were supposed to
get. Let's have a look at

# dd if=/dev/ad6s1 skip=16 |hd
# dd if=/dev/ad6s1 skip=32 |hd

> |............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...|

These definitely are false positives.

> Unless somehow I am confused...?

My verdict would be that it's indeed UFS1, whatever you think about it.

> 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?
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 


-- 
DoubleF
"That boy's about as sharp as a pound of wet liver"
		-- Foghorn Leghorn

--Signature=_Tue__9_Dec_2003_15_11_43_+0300_N2nklNd9u0/d.kbb
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/1bwNwo7hT/9lVdwRAu2OAJ9IvvVmQIjYVHT6iESLxV24XT1SeQCdG/z6
6BnuSWD9d8wCcpNn3qUhYSQ=
=VVon
-----END PGP SIGNATURE-----

--Signature=_Tue__9_Dec_2003_15_11_43_+0300_N2nklNd9u0/d.kbb--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031209151143.0c1504c3.doublef>