Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Feb 2000 12:29:31 +0100 (CET)
From:      Micke Josefsson <mj@isy.liu.se>
To:        Ernst de Haan <ernst@znerd.demon.nl>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Boot record repair program?
Message-ID:  <XFMail.000210122931.mj@isy.liu.se>
In-Reply-To: <38A28D6F.DE8BADDF@znerd.demon.nl>

next in thread | previous in thread | raw e-mail | index | archive | help

On 10-Feb-00 Ernst de Haan wrote:
> It was in `compatible' mode, cuz Winblows didn't start up if me 2nd disk
> was in `dangerously dedicated mode'.
> 
> Any help would be greatly appreciated. I'm going to install a new harddisk
> now and install FreeBSD on that one and then try to copy all data from the
> old disk to the new. Problem is, I don't know where the partitions start
>:(
> 
> I used to have my partitions like this (for what I recall):
> 
> 1st FreeBSD  (about 3 GB)
> 2nd Linux (about 3 GB?)
> 3rd Linux swap (about 120 MB)
> 
> But this is what FIPS gives me under DOS (i compressed the table):
> 
> --------------------
> Which Drive (1=0x80/2=0x81/_)? 2
> 
> Partition table:
> 
>  |boot|    Start |      |     End    | Start  |Number of|
>#|able|Hd Cyl Sec|System|Hd  Cyl  Sec| Sector |Sectors  |  MB
> -+----+----------+------+------------+--------+---------+----
> 1|yes | 1 768  63|   FFh|254 1917  63|16711935| 16753663|8180
> 2| no | 0 894  63|   FFh|254 1807  63|16753663| 16747519|8177
> 3| no | 0 768  63|   FFh|  0 1792  63|16711935| 16711935|8160
> 4| no | 0 768  63|   FFh|  0 1792  63|16711935| 16711935|8160
> 
> Checking root sector ... 
> Error: Invalid root sector signature: FF AA
> --------------------
> 
> 
> This is weird as I dont recall havig _4_ partitions (but it could be I
> created different partitions for / and /usr (?) ) and the size of the
> partitions are way out of bounds for my Quantum Fireball 6.4A (6.4 GB)
> 
> 

A partition table always have 4 entries, even if they are not used. (This is
why the 1st partition in an extended partition is number 5).

(A dangerously dedicated disk has no partition table at all. The sector used by
the partition table is used by FreeBSD instead.)

If this is the only partition info you have, you must have messed up your disk
somehow. It states there is one (1) partition which starts at cylinder 768 and
goes on till cylinder 1917. And possibly one partition inside this one (does
not make sense for now).

If this is the disk which contained the above FreeBSD/Linux/LinuxSwap then
there should have been more info in this table or in the MasterBootRecord. You
should have some info where cylindernumber is 0, this is where the 1st
partition would start.

The layout you claim should have been something like this:

FreeBSD 1    0 63 | 254 xx 63 |
Linux   0 xx+1 63 | 254 yy 63 |

where xx is cylinder boundary and yy is ending cylinder (which may NOT need to
be the actually max available cylinders, DOS/FAT-partitions may not be able to
allocate all). I'm here assuming that 1) you have set up linux and FreeBSD in
primary partitions and 2) the linux swap is contained within the linux
partition (dunno if this is the way linux actually does it). 


If the linux partition is inside an extended partition then the 2nd entry above
would have been of type EXTENDED and been pointing to yet another partition
table. This latter table would also have had 4 entries, the 1st specifying the
size of your linux partition, the 2nd pointing to possibly another extended
partition. Entries 3 and 4 would have been empty.

FreeBSD does not install in an extended partition, linux does.

The usage of the word 'partition' above is in the DOS/FAT-language, a FreeBSD
buff would have called them slices (slicii?) instead.


If you don't touch anything and can boot off a boot floppy a friend of mine has
a little hack to identify zombie partition tables laying around. With this info
you should be able to make copies of possible partition table candidates and by
time consuming (I know!) and careful bitfiddling make new partition tables.

More (all!) info about your drive would also be neccassary to continue. What
does BIOS see it as (C/H/S)? Have you repartitioned the drive before or are the
partition tables inserted only once and on a fresh drive? 

Restoring partition tables is quite fun once you get the hang of it. It's a bit
like archaeology or decryption, if that's your cup of tea!

I'd like to hear of any success
(and good luck!)
/Micke


PS. Perhaps you find it easier to start from a clean slate instead of going
through all this trouble...

PS2. The discussion above has got nothing at all to do with the partitions
FreeBSD sets up inside a slice.

----------------------------------
Michael Josefsson, MSEE
mj@isy.liu.se

This message was sent by XFMail
running on FreeBSD 3.1 
----------------------------------


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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