Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jun 2006 22:53:16 +0200
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        "Eric Anderson" <anderson@centtech.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: fdisk partition / disklabel recovery (help!)
Message-ID:  <20060613225316.53d939a3@Magellan.Leidinger.net>
In-Reply-To: <61325.10.20.200.100.1150219994.squirrel@10.20.200.100>
References:  <61325.10.20.200.100.1150219994.squirrel@10.20.200.100>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting "Eric Anderson" <anderson@centtech.com> (Tue, 13 Jun 2006 12:33:14 -0500 (CDT)):

> >From the subject, you probably already know my dilemma.  After booting a
> linux livecd (I'll refrain from naming the distro), my laptop no longer
> has any partitions.  Now, the drive was not newfs'ed with any other OS, so
> I believe only the boot loader and partitioning are messed up.  I see an
> ffsrecov tool, that could probably help me, but I want to make sure I
> don't make any bad decisions here.
> 
> So, my partitioning was something like:
> ad0
> ad0s1 DOS
> ad0s2 ??
> ad0s3 ??
> ad0s4 Linux root / swap

For this particular reason I always print out the layout. Got hit once,
wrote a program to recover (only understands ufs1 disklabels, and
stopped to work after a particular 4.x... I assume it's because of a
blocksize/fragsize change introduced then), learned my lesson.

> FreeBSD was on either ad0s2 or ad0s3, I can't recall which, but I believe
> it was ad0s3.  I had 3 partitions (/, /alt, /home) and a swap.
> 
> I'm running the ffsrecov tool now, but it appears to be very slow chugging
> through the disk.

There are ways to speed such a search up. I assume my own tool tries to
be too smart (or it's not smart enough, at least it uses wrong
invariants) for the disklabels. And it only prints assumptions about
the start of a FreeBSD slice, not about other slice types.

> Is there any additional ways I can find the partitioning scheme, or find
> the bsdlabel's on the disk?   Does anyone know of a command line (dd+some

Try to remember them. If you know how large the partitions have been,
you just have to write the MBR and everything should work. If nothing
works, you remembered wrong.

> tools/perl/etc) way to find the bsdlabels?
> 
> Once the bsdlabels are found, then what?
> 
> Also - if I rewrite the bsdlabel exactly as it was before, I should be in
> business, correct?

The bsdlabels are still there I assume, it sounds just like your MBR
got hosed.

Bye,
Alexander.

-- 
Selling GoodYear Eagle F1 235/40ZR18, 2x 4mm + 2x 5mm, ~150 EUR
you have to pick it up between Germany/Saarland and Luxembourg/Capellen
http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137



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