On Mon, 8 Dec 2003 21:52:54 -0800 (PST)
"Scott I. Remick" <[EMAIL PROTECTED]> probably wrote:

> 
> --- Sergey 'DoubleF' Zaharchenko <[EMAIL PROTECTED]> 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?
> _______________________________________________
> [EMAIL PROTECTED] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
> 


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

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to