From owner-freebsd-questions@FreeBSD.ORG Mon Jun 30 17:34:29 2003 Return-Path: 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 C65B637B401; Mon, 30 Jun 2003 17:34:29 -0700 (PDT) Received: from pc-80-195-57-71-ll.blueyonder.co.uk (pc-80-195-57-71-ll.blueyonder.co.uk [80.195.57.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88D4643F3F; Mon, 30 Jun 2003 17:34:28 -0700 (PDT) (envelope-from andrew@cream.org) Received: from spatula.home (spatula.home [192.168.0.4]) by gateway.home (Postfix) with ESMTP id 0F74C53; Tue, 1 Jul 2003 01:34:26 +0100 (BST) From: Andrew Boothman To: Scott Reese Date: Tue, 1 Jul 2003 01:34:36 +0100 User-Agent: KMail/1.5.2 References: <1056997197.39385.25.camel@borges> <200306302310.34846.andrew@cream.org> <1057012562.694.20.camel@borges> In-Reply-To: <1057012562.694.20.camel@borges> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307010134.36616.andrew@cream.org> cc: Marc Wiz cc: freebsd-questions@FreeBSD.org cc: current@FreeBSD.org Subject: Re: 5.1-RELEASE & Windows XP dual-boot issues X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2003 00:34:30 -0000 On Monday 30 June 2003 11:36 pm, Scott Reese wrote: > On Mon, 2003-06-30 at 22:10, Andrew Boothman wrote: > > On Monday 30 June 2003 7:19 pm, Scott Reese wrote: > > > Previously, I had a dual-boot setup with FreeBSD 5.0 and Windows XP. I > > > was using booteasy as the boot loader and I had no problem booting into > > > either Windows or FreeBSD. However, I found myself having to reinstall > > > FreeBSD so I decided to go with 5.1-RELEASE. As usual, I chose to use > > > the FreeBSD boot loader on ad0 (the Windows drive) and to install a > > > standard mbr on ad1 (the FreeBSD drive). After the install, I was able > > > to boot FreeBSD with no problems at all, but when I went to boot up > > > Windows, I received the dreaded 'NTLDR missing' message. > > > > This seems to be a recurring problem after 5-RELEASE. I had exactly the > > same problem, and I know of others that are the same. For some reason > > -current doesn't seem to be inter-operating well with the WinXP/Win2k > > loader anymore. I'm not sure if it's only happening to some installations > > - but I was certainly in the same boat. > > > > I ended up having to re-install Win2k and I used Grub as my new > > bootloader. > > This sounds promising. If you don't mind my asking, what steps did you > follow exactly? I've never used grub before and I'd like to avoid > reversing my current situation (having a bootable Windows installation, > but suddenly rendering my FreeBSD install unreachable). Here's a message from George Hartzell that he posted to -current in response to me having trouble. For some reason I can't persuade the mailing list search mechanism to return anything at the moment so here's the message again in it's entirety : (Unfortunately - by stunning coincidence - I recently hosed by Grub installation so I can't use my own system to show others how to get it working ;) Hopefully this email will be enough to get you going) ---------- Forwarded Message ---------- Subject: Re: "NTLDR missing" after 5-RELEASE install Date: Thursday 27 February 2003 6:52 pm From: George Hartzell To: "Andrew Boothman" Cc: "Darryl Okahata" , Andrew Boothman writes: > [...] > OK Guys, I think I'm still a little confused here. > > I've just had a few botched installs of GRUB so I think I need a little > more direction, if you could :) > > I've got GRUB on a floppy and it boots fine. If I type : > rootnoverify (hd0,0) > makeactive > chainloader +1 > boot > > I get Win2k booted no problem! > > So, following the instructions in the Grub Manual, I typed > root(fd0) > setup(hd0) > > I remove the floppy from the drive and reboot > > On boot I get "Loading GRUB... Please Wait..." but after that I get "GRUB > Error 17" which according to the manual means that GRUB doesn't know how > to load the selected partition. Even though when I boot from the floppy it > starts no problem and I can type commands to get it to boot Win2k.... That told it to install GRUB into the beginning of (hd0) [e.g. the Master Boot record], but configured it to use (fd0) as the root of the place to find stuff. Since the floppy wasn't in when you booted, it didn't do anything useful. There are some grub things that need to be on the disk that you give the "root" designation too, e.g. "stage1", etc... I don't know how/where to install those files into an NTFS partition, I assume that GRUB can read NTFS filesystems, and you could tuck them there, but I don't know for sure. Here's what I'd do. Get yourself booted into freebsd any way that you can. PRINT OUT THE INFORMATION ABOUT YOUR BIOS PARTITION TABLE AND YOUR FREEBSD DISKLABEL, AND SAVE IT. "fdisk -s" and "disklabel -r diskname" are your friends!!!! Build grub from the ports tree and install it. It installs all of the juicy bits into some directory in /usr/local/share/grub/i386-freebsd/..., which doesn't seem to be a place where grub can find it. I make a directory called /boot/grub and copy all of them there. Start grub (e.g. boot from your grub floppy). Under the 5.0 systems, GEOM is picky about letting you doink with disks that you have mounted, so you either need the "let me shoot myself in the foot sysctl patch (ftp://ftp.jurai.net/users/winter/patches/geom-foot.patch) or boot from something else (e.g. floppy, live cdrom, ...) Make sure that grub can see it's various interesting bits: grub> find /boot/grub/stage1 and it should say: (hd0,1,a) assuming that you have Something Else (e.g. windows) in the first primary BIOS partition/slice, a set of FreeBSD slices in the second primary BIOS partition/slice, and the /boot/grub stuff is in the first ("a") BSD_DISKLABEL/slice. If you have the grub bits living in a Linux filesystem in the third primary BIOS partition, it'd say (hd0,2). If you had them in a Linux filesystem living in the first extended partition, it'd say (hd0,4), etc.... That's the drive that you want to declare as your root, which just configures the low level grub code that "setup" installs so that it knows where to look for it's various useful bits. e.g. grub> root (hd0,1,a) Then you need to install grub onto somewhere where the computer will trip over it and boot it. One possibility is to install it into the master boot record, which would be: grub> setup (hd0) Here you boot process would be power on->bios->load the MBR which is really GRUB->grub loads its stage1,... Or you could leave a "normal" MBR at the beginning of the disk and install GRUB into the beginning of the FreeBSD BIOS partition (assuming that FreeBSD is in the second primary parition): grub> setup (hd0,1) If that's all that you do, thing's won't quite boot. You'll need to also mark that partition active, so that the stock MBR code will jump to it. I always do that by getting to this point, booting by hook or by crook (e.g. a grub boot floppy, a bootable freebsd CD, a bootable linux CD) and using some utility (e.g. partition magic from windows, fdisk from windows, fdisk from freebsd, fdisk or cfdisk from linux) to mark the partition active. I prefer partition magic because I believe that it has the most robust partition table integrity checks, but whatever you trust.... Now, your boot process will look like: power on->bios->"real" MBR which jumps to the active parition -> (next line) ... -> GRUB at the beginning of active partition -> GRUB stage1,... When grub get's up and running, it'll look for a file called menu.lst (unless you override the name when you "setup") which contains the info for the boot menu. Here's mine (notice that there are a bunch of mutually exclusive things that I've tucked into the 3rd BIOS partition at various times and I just keep the info around for reference. As long as I don't actually choose any of the "wrong" selections, there's no trouble. default=0 timeout=10 title FreeBSD 4.7 root (hd0,1,a) kernel /boot/loader title FreeBSD 5.0 root (hd0,2,a) kernel /boot/loader title Redhat Linux 8.0 root (hd0,2) kernel /boot/vmlinuz-2.4.18-14 ro root=/dev/hda3 initrd /boot/initrd-2.4.18-14.img title Redhat Linux 8.0 (hires) root (hd0,2) kernel /boot/vmlinuz-2.4.18-14 ro root=/dev/hda3 vga=791 initrd /boot/initrd-2.4.18-14.img title Windows 2000 rootnoverify (hd0,0) chainloader +1 > I then used "fdisk /mbr" on a Windows 98 boot disk to remove GRUB and get > me back to a normal Win2k boot. But that doesn't help me get FreeBSD dual > booting..... > > Can you offer any insight into how to make this work? I remember using > GRUB before and being very happy with it, but it was installed for me by > RedHat.... *REMEMBER* run an "fdisk -s" and print out the output run and "disklabel -r ad0" (or whatever device) and print out the info. BEFORE you start playing around!!!! g. ------------------------------------------------------- I left out a detail: I use the --prefix=/boot/grub option to setup. e.g. setup --prefix=/boot/grub (hd0) or setup --prefix=/boot/grub (hd0,1) g.