From owner-freebsd-questions@FreeBSD.ORG Thu Dec 22 19:25:14 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D34D16A41F for ; Thu, 22 Dec 2005 19:25:14 +0000 (GMT) (envelope-from gs_stoller@juno.com) Received: from outbound-mail.nyc.untd.com (outbound-mail.nyc.untd.com [64.136.20.164]) by mx1.FreeBSD.org (Postfix) with SMTP id 8E90B43D69 for ; Thu, 22 Dec 2005 19:25:10 +0000 (GMT) (envelope-from gs_stoller@juno.com) Received: from webmail49.nyc.untd.com (webmail49.nyc.untd.com [10.141.27.189]) by smtpout06.nyc.untd.com with SMTP id AABB4X9NTAL755US for (sender ); Thu, 22 Dec 2005 11:25:05 -0800 (PST) Received: (from gs_stoller@juno.com) by webmail49.nyc.untd.com (jqueuemail) id LCUMW246; Thu, 22 Dec 2005 11:24:22 PST Received: from [67.84.55.15] by webmail49.nyc.untd.com with HTTP: Thu, 22 Dec 2005 19:23:24 GMT X-Originating-IP: [67.84.55.15] Mime-Version: 1.0 From: "gs_stoller@juno.com" X-UOL-SENDER: gs_stoller@juno.com Sender: gs_stoller@juno.com Date: Thu, 22 Dec 2005 19:23:24 GMT To: freebsd-questions@freebsd.org X-Mailer: Webmail Version 4.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Type: text/plain Message-Id: <20051222.112422.14922.174120@webmail49.nyc.untd.com> X-ContentStamp: 13:6:3754578810 X-UNTD-OriginStamp: /s5f1SIGSI3+WdnoYQ8yRKUN2Rb+YKG4J5dgLFA4eHLSHf+brvjqig== X-UNTD-Peer-Info: 10.141.27.189|webmail49.nyc.untd.com|webmail49.nyc.untd.com|gs_stoller@juno.com Cc: GS_Stoller@juno.com Subject: slice-table / partition-table X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2005 19:25:14 -0000 I have 2 hard drives on my system. One (my main drive) has an MS-DOS slice (naturally the first slice) and 3 FreeBSD slices. The other drive had 1 OS2 slice (just because an OS2 CDROM was used to slice it up) and 1 MS-DOS slice. At one time, I was thinking of putting the boot program on the second hard drive, and may have done it with the CDROM of FreeBSD 4.7 . Recently, while I was running MS-DOS and processing e-mail (trying to remove an attachment from a letter in order to save it in the MS-DOS slice on the second hard drive) through juno.com , I discovered that the MS-DOS slice on this second hard drive was hosed (naturally, that discovery could only be made while running MS-DOS ), and verified that fact by trying to go to = a directory on that second drive. MS-DOS didn't go there but complain= ed, and following that I couldn't see anything on that second drive. To investigate this, I rebooted into my FreeBSD 4.3 slice and found that the slice-table (often called "partition-table") on the sec= ond drive was identical to that of the first drive. In fact, when I tri= ed fdisk on each drive, I found the results identical except for the s= ize (# of cylinders) of the drives. Originally, the second drive's fdi= sk results stated 3 heads and some sectors per cylinder (but I don't re= call how many). I conclude that there is a strong possibility that only= the slice-table sector has been copied (from the first drive), though= I have no idea how this could have happened (though I consider the poss= ible putting of the boot program on the second hard drive as possibly co= ntributory). Does anyone have any idea of how this can happen? Has any= one seen this or the like before? I also conclude that there is a strong possibility that the rest of the= second disk (i.e., my data on it) is okay, and if I can rebuild the sl= ice-table then I can recover the rest of the disk and all my data. I t= hink I can do this if I can get the following things/information: 1) is there a duplicate of the slice-table = somewhere on the disk, and if so, where is it, and how can I exam= ine it rather than the primary slice-table , and is there a way to have its contents replace the contents of the primary slice-table , 2) is there a program that can look at a(n entire) disk and break i= t up into contiguous sectors that belong to particular systems (in m= y case OS2 or MS-DOS ), {I would be willing to write such a pr= ogram if someone would tell me how to read sectors without a slice-= table [say with just an LBA number] and how to recognize whet= her a sector belongs to OS2 or MS-DOS , and any timing constraint= s for reading/writing cylinders [e.g., usual timing for getting a = read/write head to cylinder 0 , the time to move between cylinders, etc.], if such constraints exist [mayb= e we have fixed heads and so no timing constraints]}, 3) FreeBSD programs (or Linux programs or MS-DOS programs i= f FreeBSD programs aren't available) that can read any sector give= n its LBA number or the like [somewhat like fdisk reads/writ= es of sector 0 ], what could be really useful [if I have to rebuild= files] is a program that reads a range of sectors and greps it= s contents, reporting the LBA = number [and some contents] of those sectors that pass the grep = test, 4) the structure of the slice-table's sector and = of the slice-table and FreeBSD programs that can write specif= ic values (given as arguments [say in structures]) into the sl= ice-table without affecting the contents of any other sector on that= disk, 5) how to mark a slice "", 6) FreeBSD programs (or Linux programs or MS-DOS programs if = FreeBSD programs aren't available) other than fdisk that can wri= te the slice-table's sector (including its magic number and boo= t code) without affecting the contents of any other sectoron that di= sk, 7) how can I recognize sectors that were in a slice assigned for = MS-DOS usage, and/or is there a way of finding the "first" (i.e., o= ne with lowest LBA ) and "last" sector assigned for MS-DOS us= age or used by MS-DOS , 8) FreeBSD programs (or Linux programs or MS-DOS programs if = FreeBSD programs aren't available) software to rebuild files and = [Windows-98] directories from fragments (with human direction) [t= his is just in case there is more damage than I suspect at present, I'm hoping not to need this one], 9) any caveats or information that would prove useful in this ende= avor. If I have to rebuild the slice-table from scratch, I presume that I c= an make any entries I wish in the slice-table and then look at the con= tents of the slices to see if they are what I would like to find there= and appropriately change the slice-table until I find it set up as it= was before. Anything wrong with my presumption? If I succeed in this, I'm thinking of publishing an article on how to r= ecover from this sort of problem. uname -a for my system gives: FreeBSD 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Sat Apr 21 10:54:49 GMT 200= 1 jkh@narf.osd.bsdi.com:/usr/src/sys/compile/GENERIC i386