Date: Thu, 22 Dec 2005 19:23:24 GMT From: "gs_stoller@juno.com" <gs_stoller@juno.com> To: freebsd-questions@freebsd.org Cc: GS_Stoller@juno.com Subject: slice-table / partition-table Message-ID: <20051222.112422.14922.174120@webmail49.nyc.untd.com>
next in thread | raw e-mail | index | archive | help
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 "<UNUSED>", 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051222.112422.14922.174120>