From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 13 21:02:35 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7DEED16A41B for ; Tue, 13 Jun 2006 21:02:35 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id C967F43D48 for ; Tue, 13 Jun 2006 21:02:34 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from webmail.centtech.com (mailbox.centtech.com [10.20.0.15]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id k5DL2Xps055552; Tue, 13 Jun 2006 16:02:33 -0500 (CDT) (envelope-from anderson@centtech.com) Received: from 10.20.200.100 (SquirrelMail authenticated user anderson); by otter.centtech.com with HTTP; Tue, 13 Jun 2006 16:02:33 -0500 (CDT) Message-ID: <54950.10.20.200.100.1150232553.squirrel@10.20.200.100> In-Reply-To: <20060613225316.53d939a3@Magellan.Leidinger.net> References: <61325.10.20.200.100.1150219994.squirrel@10.20.200.100> <20060613225316.53d939a3@Magellan.Leidinger.net> Date: Tue, 13 Jun 2006 16:02:33 -0500 (CDT) From: "Eric Anderson" To: "Alexander Leidinger" User-Agent: SquirrelMail/1.5.0 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Scanned: ClamAV 0.87.1/1537/Tue Jun 13 06:24:06 2006 on mh2.centtech.com X-Virus-Status: Clean Cc: freebsd-hackers@freebsd.org Subject: Re: fdisk partition / disklabel recovery (help!) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jun 2006 21:02:35 -0000 Alexander Leidinger said: > Quoting "Eric Anderson" (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. I'll probably look into writing such a tool, since this is very painful. :( Printing is a good idea. :) >> 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 a good way to identify the bsdlabel, or other partitioning information from a hexdumped output? >> 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. I have some general guesses as to the sizes. Do you know if any of that data would be in a dmesg,sysctl,etc type output? I have much of that logged to an external site I can look at for the details.. >> 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. fdisk reports nothing, so I'm sure I just need to put the fdisk partitioning back. Problem is, I don't know the offsets. Eric -- ------------------------------------------------------------- Eric Anderson anderson@centtech.com Centaur Technology You have my continuous partial attention -------------------------------------------------------------