Date: Thu, 4 Dec 2003 18:03:52 +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: <20031204180352.7c4e7571.doublef@tele-kom.ru> In-Reply-To: <20031204141740.61859.qmail@web41102.mail.yahoo.com> References: <20031204154917.659f2b54.doublef@tele-kom.ru> <20031204141740.61859.qmail@web41102.mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Signature=_Thu__4_Dec_2003_18_03_52_+0300_KlXkfUp+4EL8l8=P Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit On Thu, 4 Dec 2003 06:17:40 -0800 (PST) "Scott I. Remick" <scott@sremick.net> probably wrote: > > --- Sergey 'DoubleF' Zaharchenko <doublef@tele-kom.ru> wrote: [so you want the list cc'd. good...] > > Oh yes there are... what's surprising? If you are sure that the problem > > is with the superblock, pick any you wish. > > > > The actual number of superblock copies depends on the disk size and the > > parameters you give to newfs. > > [...] > > > It's about THE superblock, not a superblock copy. There can be only one > > superblock. There may be many copies. But if you dd them to the > > superblock, that'll be fine. > > Ahh ok, I've learned something new. Guess I misinterpreted the information I > found online. I'm not complaining: this is GOOD news. :) > > > BTW, what's the output of ``disklabel -r /dev/ad6s1c'' ? > > su-2.05b# disklabel -r /dev/ad6s1c > # /dev/ad6s1c: > 8 partitions: > # size offset fstype [fsize bsize bps/cpg] > c: 156344517 63 unused 0 0 # "raw" part, don't edit > e: 156344517 63 4.2BSD 2048 16384 89 > partition c: partition extends past end of unit > disklabel: partition c doesn't start at 0! > disklabel: An incorrect partition c may cause problems for standard system > utilities > partition e: partition extends past end of unit > > That doesn't look good. True. > By the way, the past posts I've read suggest that even if I use fsck_ffs -b > to run fsck with a diff superblock (say, the one at 160) that it doesn't > actually fix the master copy, and that I still need to use dd to fix the > original. The command I've seen used is: > > dd if=/dev/ad6s1c skip=32 of=/dev/ad6s1c seek=16 bs=512 count=16 In fact, when you mess with superblocks, it's messing with filesystems (thus it's different from messing with disklabels). So I guess you should use /dev/ad6s1e here. `e' should be the partition, and `c' --- the whole disk. > 1) Do I just replace the 32 of "skip=32" with 160 (or whichever superblock > makes fsck_ffs -b happy)? Probably yes. The thing is you want to copy some 8192 bytes from one location to another. But I never had a chance to treat a superblock that way... Go ask a person who did! > 2) I've also read that the size and location of the original superblock can > vary. Do I have to modify the seek/bs/count values to account for this? And Yes. skip here is the location of the copy, seek is the location of the superblock (see below for values). > if so, how do I find the proper values? > > Nothing done yet... don't wanna screw this up. Thanks everyone! If you want to be more sure, try dd'ing your (suspectedly damaged) superblock and some of its (suspectedly OK) copies into different files: # dd if=/dev/ad6s1e skip=... bs=512 count=16 of=somefile As /usr/src/sys/ufs/ffs/fs.h suggests, for THE superblock skip should be 16 if you have UFS1 or 128 or 512 if you have UFS2 (if my maths is correct). These commands shouldn't do anything harmful to /dev/ad6s1e. Of course, after that, you could hack up a program which will read superblocks and display them according to their structure defined as `struct fs' in /usr/src/sys/ufs/ffs/fs.h. Let's not do it today, right? If your superblock copies will appear similar to each other (use cmp(1) or md5(1)), then you can be sure that you've found the copies (so far you haven't done any mistakes in your calculations). Then it's up to you to commit the change. I've just tried it on a test machine. The copies matched. Hmm:) > ===== > 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 Peter's Law of Substitution: Look after the molehills, and the mountains will look after themselves. --Signature=_Thu__4_Dec_2003_18_03_52_+0300_KlXkfUp+4EL8l8=P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/z0zjwo7hT/9lVdwRAjTTAJoDN5bJsWmtHn8Ihi0ywTh56jjyfQCfY+7T XM4QAZwnvBgA0Z/v8Up9UEk= =AbV0 -----END PGP SIGNATURE----- --Signature=_Thu__4_Dec_2003_18_03_52_+0300_KlXkfUp+4EL8l8=P--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031204180352.7c4e7571.doublef>