From owner-freebsd-questions Fri Jun 9 10:40:29 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mta02-svc.server.ntlworld.com (mta02-svc.ntlworld.com [62.253.162.42]) by hub.freebsd.org (Postfix) with ESMTP id 1F29937C4C3 for ; Fri, 9 Jun 2000 10:40:21 -0700 (PDT) (envelope-from mark@ukug.uk.freebsd.org) Received: from parish.my.domain ([62.253.89.31]) by mta02-svc.server.ntlworld.com (InterMail vM.4.01.02.27 201-229-119-110) with ESMTP id <20000609183954.CKKL10065.mta02-svc.server.ntlworld.com@parish.my.domain>; Fri, 9 Jun 2000 18:39:54 +0000 Received: (from mark@localhost) by parish.my.domain (8.9.3/8.9.3) id SAA00909; Fri, 9 Jun 2000 18:40:14 +0100 (BST) (envelope-from mark) Date: Fri, 9 Jun 2000 18:40:13 +0100 From: Mark Ovens To: "Jasper O'Malley" Cc: freebsd-questions@freebsd.org Subject: Re: Active partition problems with FreeBSD 4.0/NT dual-boot Message-ID: <20000609184013.B233@parish> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0.1i In-Reply-To: ; from jooji@nickelkid.com on Fri, Jun 09, 2000 at 12:24:10PM -0400 Organization: Total lack of Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Jun 09, 2000 at 12:24:10PM -0400, Jasper O'Malley wrote: > > I have a completely aggravating problem on my hand. > > I've got NT 4.0 installed on a the first partition (NTFS) on da0, and > FreeBSD 4.0 installed on the first partition of da1. When I installed > FreeBSD, I instructed it to install a bootloader on da1, but not da0, with > the intention of allowing NTLDR handle the OS selection. After installation, > I FTPed /boot/boot0 to another box (since I don't have any FAT partitions > on my machine) and rebooted. I got the NTLDR screen, booted into NT, FTPed > boot0 back to the NTFS partition, renamed it bootsect.bsd, and added the > following line to C:\boot.ini: > > C:\BOOTSECT.BSD="FreeBSD 4.0" > > When I rebooted, I selected "FreeBSD 4.0" from the list, and got the > FreeBSD loader with a single option: > > F5 Drive 1 > > I hit F5, and got a second loader menu: > > F1 FreeBSD > F5 Drive 0 > > I hit F1 to boot into FreeBSD, and I thought all was well. However, when I > rebooted to get back into NT, I was presented with the following error > message: > > Not found any [active partition] in HDD > Oh shit (not to put too fine a point on it). boot0 has overwritten your Partition Table. I did *exactly* the same thing earlier this week (although in a slightly different way). The good news is that I managed to rebuild my PT without losing a single byte of data. OK, what happened was this. When you selected FreeBSD from NTLDR, it ran C:\BOOTSECT.BSD, aka boot0, which then gave you the FreeBSD boot menu. boot0 "remembers" the last OS booted, which it does by setting the active byte on the relevant entry in the PT. Now, I don't know the intimate details of exactly what happens because boot0 is written in assembler, but it appears that it writes this change to the MBR by changing the active flag on the in-memory copy and writing the whole 512 bytes back to disk. Since *your* boot0 is from /boot it has no PT. If you had installed it then the installer would have copied the PT before updating the MBR. Your PT probably looks like this now. 000001a0 4c 69 6e 75 f8 46 72 65 65 42 53 c4 90 90 90 90 |LinuøFreeBSÄ....| 000001b0 90 90 44 72 69 76 65 20 00 00 80 0f b6 00 00 00 |..Drive ....¶...| 000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............Uª| Boot from kern.flp and mfsroot.flp and select the Fixit option (you'll need the Fixit floppy), then type: # dd if=/dev/rda0 bs=512 count=1 and see if what comes out. OK, how to fix it. Well, if neither the NT or FreeBSD partitions contain important data then re-installing both maybe the quickest option. If this isn't an option then you will need to rebuild your PT, but since you only have one OS on each disk it should be easier than mine was since I have 3 OS on one disk, with NT in an extended partition. As I have just gone through all this myself (successfully) I'll gladly assist you if you wish (perhaps this would be best done off list). > I booted from a Win98 startup floppy, Do you have a copy of Norton's DISKEDIT? > used fdisk to set the first > partition on da0 active, and rebooted again. This time, I was presented > with the following loader menu: > > F1 ?? > F5 Drive 1 > > I thought this was weird, since I never explicitly installed the FreeBSD > loader onto da0. Pressing F1 brought me to the NTLDR screen, as I > expected, and I was able to boot into NT again. When I rebooted, I got the > save loader menu again, and this time I hit F5, then F1 to boot into > FreeBSD. Upon a reboot, bam, back to: > > Not found any [active partition] in HDD > > After doing some reading, I'm guessing the problem is that I've a > brain-dead Award BIOS variant on my GA-686LX4 motherboard that assumes > you're using an M$ OS and checks for active partitions on the lowest > numbered BIOS disk present (da0, in this case) before it hands control > over to any MBR bootloader. If there aren't any active partitions, the > BIOS craps out with the above error. > > Now, for the questions: > > 1) How did the FreeBSD loader find its way onto the MBR of da0? It > obviously wasn't there before I selected "FreeBSD 4.0" from the > NTLDR menu the first time, but it seems that it's been there ever > since. Is this by design? > > 2) Is there any way to keep whatever is clearing the "active" flag on > the first partition of da0 from doing so? I tried upgrading the BIOS > for the motherboard to the latest version, but the active partition > checking "feature" is still present. > > Thanks, > Mick > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- ...and on the eighth day God created UNIX ________________________________________________________________ FreeBSD - The Power To Serve http://www.freebsd.org My Webpage http://ukug.uk.freebsd.org/~mark/ mailto:mark@ukug.uk.freebsd.org http://www.radan.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message