Help deriving a corrupted disklabel

2005-11-30 Thread Doug H
One of my disks has 3 active partitions: FreeBSD 5.4-RC3, NTFS
(not-bootable), and FreeBSD 6.0-RELEASE.

I developed problems while installing FreeBSD 6.0.  Installation went as
well as can be expected using sysinstall (no difficulty other than pulling
packages from the CD), but when I rebooted, nothing was bootable on that
disk.  I verified that the boot record (using boot0) seems okay: slice table
is fine (40G, 80G, 40G, and 40G unused on 200G drive).

Using bsdlabel, I confirmed that slice 3 (FreeBSD 6) is fine, but for some
reason I'm not concerned with now, is unbootable.

PROBLEM: bsdlabel showed me that slice 1 (FreeBSD 5.4) is damaged and only
partition c existed and was incorrect.  I do not have / cannot find a
written copy of my disklabel for that disk (a good suggestion to *strongly
emphasize* in the installation manual for newbies!).  I did recall that
ad1s1a ('/') was 512M, so I was able to write a label and mount that
partition from a "Fixit" shell.

QUESTIONS: How can I rederive the remaining disklabel for that disk?  Could
a copy possibly be stored somewhere on root if I didn't do it myself when
building the system?

I have not tried to boot from that root partition.  Trying several possible
labels has resulted in "incorrect super block" errors for the partitions
after 'a'.  Random guessing will be very tedious.

My research has indicated that I could binary grep the raw ad1s1c partition
to locate the magic numbers for the super blocks and derive the partitions
from that information.  I even found a little 'c' language program Peter
Dufault posted 11 years ago on this list to locate magic numbers.

My hope is that in 11 years of development, FreeBSD would have created a
clever tool to aid this process!  I've found enough entries in these lists
to think that the effort would be justified and much appreciated.  If there
is no tool, can someone tell me the value of FS_UFS2_MAGIC?  I presume
that's what I should search for - it's a UFS2 filesystem.  Having only a
"Fixit" shell is somewhat limiting.

Thanks,
Doug
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Help deriving a corrupted disklabel

2005-12-01 Thread Anish Mistry
On Wednesday 30 November 2005 09:15 pm, Doug H wrote:
> One of my disks has 3 active partitions: FreeBSD 5.4-RC3, NTFS
> (not-bootable), and FreeBSD 6.0-RELEASE.
>
> I developed problems while installing FreeBSD 6.0.  Installation
> went as well as can be expected using sysinstall (no difficulty
> other than pulling packages from the CD), but when I rebooted,
> nothing was bootable on that disk.  I verified that the boot record
> (using boot0) seems okay: slice table is fine (40G, 80G, 40G, and
> 40G unused on 200G drive).
>
> Using bsdlabel, I confirmed that slice 3 (FreeBSD 6) is fine, but
> for some reason I'm not concerned with now, is unbootable.
>
> PROBLEM: bsdlabel showed me that slice 1 (FreeBSD 5.4) is damaged
> and only partition c existed and was incorrect.  I do not have /
> cannot find a written copy of my disklabel for that disk (a good
> suggestion to *strongly emphasize* in the installation manual for
> newbies!).  I did recall that ad1s1a ('/') was 512M, so I was able
> to write a label and mount that partition from a "Fixit" shell.
>
> QUESTIONS: How can I rederive the remaining disklabel for that
> disk?  Could a copy possibly be stored somewhere on root if I
> didn't do it myself when building the system?
>
> I have not tried to boot from that root partition.  Trying several
> possible labels has resulted in "incorrect super block" errors for
> the partitions after 'a'.  Random guessing will be very tedious.
>
> My research has indicated that I could binary grep the raw ad1s1c
> partition to locate the magic numbers for the super blocks and
> derive the partitions from that information.  I even found a little
> 'c' language program Peter Dufault posted 11 years ago on this list
> to locate magic numbers.
>
> My hope is that in 11 years of development, FreeBSD would have
> created a clever tool to aid this process!  I've found enough
> entries in these lists to think that the effort would be justified
> and much appreciated.  If there is no tool, can someone tell me the
> value of FS_UFS2_MAGIC?  I presume that's what I should search for
> - it's a UFS2 filesystem.  Having only a "Fixit" shell is somewhat
> limiting.
>
sysutils/scan_ffs
I've always used it from a emergency FreeBSD diagnostic CD (custom 
Freesbie) and it works great.  I've never been stuck with only a 
fixit shell though.

-- 
Anish Mistry


pgpEMb2pnEvII.pgp
Description: PGP signature


Re: Help deriving a corrupted disklabel

2005-12-02 Thread Doug H
Hi Anish,

Thanks for the reply -- scan_ffs did exactly what I needed it to do!

For those who encounter a similar problem (damaged disklabel on a FreeBSD
slice), it's not as simple as one might hope, since I was limited to the
"Fixit" shell on the FreeBSD 6.0-RELEASE CD.

scan_ffs is not on the CD, which makes it much more difficult (configuring
networking, obtaining it via ftp, unpacking the package, etc., since
'pkg_add -r' doesn't work in a Fixit shell).  Setup was most of the work!
Once I had a usable copy of scan_ffs, the rest was simple.

Thanks again for the help.  Without it, I'm sure I'd still be struggling to
use dd and grep to locate magic numbers using a shell script.

Doug


On 12/2/05, Anish Mistry <[EMAIL PROTECTED]> wrote:
>
> On Wednesday 30 November 2005 09:15 pm, Doug H wrote:
> > 
> > PROBLEM: bsdlabel showed me that slice 1 (FreeBSD 5.4) is damaged
> > and only partition c existed and was incorrect.  I do not have /
> > cannot find a written copy of my disklabel for that disk (a good
> > suggestion to *strongly emphasize* in the installation manual for
> > newbies!).  I did recall that ad1s1a ('/') was 512M, so I was able
> > to write a label and mount that partition from a "Fixit" shell.
> >
> > QUESTIONS: How can I rederive the remaining disklabel for that
> > disk?  Could a copy possibly be stored somewhere on root if I
> > didn't do it myself when building the system?
> > 
>
>
> sysutils/scan_ffs
> I've always used it from a emergency FreeBSD diagnostic CD (custom
> Freesbie) and it works great.  I've never been stuck with only a
> fixit shell though.
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"