# FreeBSD and WindowsXp



## centurion (Mar 16, 2009)

Last time I installed WindowsXp, then I installed FreeBSD. And now during system's boot I can only select FreeBSD, there isn't Windows(DOS) to select. Which file have I to update and how to do this ? 

Both system are installed on same disk, only on other partitions.


----------



## Djn (Mar 16, 2009)

If you boot from a FreeBSD CD, and then in sysinstall use Configure->Fdisk, press W to write (without changing anything), and choose BootMgr, you should get a DOS/FreeBSD menu at boot.

I'm sure there's a way to modify an in-use disk as well.


----------



## centurion (Mar 16, 2009)

After press W (on freebsd) then select BootMgr it retuened error:

*ERROR: Unable to write data to disk ad4!

To edit the labels on a running system set sysctl kern.geom.debug lage=16 and try again.*

After it another:

*Disk partiton write returned an error status!*

Any ideas ? ;]


----------



## SirDice (Mar 16, 2009)

Press ALT-F2, log in as root, enter that sysctl, press ALT-F1 and try again


----------



## centurion (Mar 16, 2009)

It doesn't work, but I'm not sure this I understood well what you told me. Before log as root I press ALT-F2, then I logged as root, after that I did what wrote *Djn* then I press ALT-F1 and rebooted, and nothing. ;/

What is "enter that sysctl" means ?


----------



## ale (Mar 16, 2009)

Run `# sysctl kern.geom.debugflags=16` before running sysinstall.


----------



## Djn (Mar 16, 2009)

Note that I said
1) "Boot from a CD"
2) "There's probably a way to do this on a running system".

You're trying to do 2), so listen to ale.


----------



## ale (Mar 16, 2009)

Djn said:
			
		

> Note that I said
> 1) "Boot from a CD"


Sorry, I've missed that.



			
				Djn said:
			
		

> 2) "There's probably a way to do this on a running system".


After setting the sysctl as the (miscopied) error message, SirDice and I said, should work.


----------



## Erratus (Mar 16, 2009)

centurion said:
			
		

> Last time I installed WindowsXp, then I installed FreeBSD. And now during system's boot I can only select FreeBSD, there isn't Windows(DOS) to select. Which file have I to update and how to do this ?
> 
> Both system are installed on same disk, only on other partitions.


To me it sounds like you lost your MBR boot manager. 
You can choose which one you want to use. 
So you can even reinstall the XP bootmanager.


----------



## centurion (Mar 17, 2009)

*Erratus* I've got installed MBR boot manager. And it work but I haven't choice to select WindowsXp (only FreeBSD). 
*Djn* and *ale* I'll check it out later(I'll write back tommorow, becouse now I haven't access to my laptop - don't ask why )


----------



## SirDice (Mar 17, 2009)

centurion said:
			
		

> *Erratus* I've got installed MBR boot manager. And it work but I haven't choice to select WindowsXp (only FreeBSD).
> *Djn* and *ale* I'll check it out later(I'll write back tommorow, becouse now I haven't access to my laptop - don't ask why )



Login as root, what's the output of *fdisk*?

It's possible you've nuked your Windows partition during the fbsd install.


----------



## mickey (Mar 17, 2009)

There's also the possibility to use the standard Windows XP bootloader to boot both, FreeBSD and Windows XP. For this to work you will have to place a copy of the file /boot/boot1 on your Windows C: drive as say "BOOT1.BSD". Then use a text editor to add an entry to the "operating systems" section of your BOOT.INI file that looks like this:

```
C:\BOOT1.BSD="FreeBSD 7.1"
```
If you have trouble seeing/saving the boot.ini file, use the ATTRIB command before/after editing the file, to clear/restore any system, hidden and read-only file attributes.


----------



## SirDice (Mar 17, 2009)

mickey said:
			
		

> If you have trouble seeing/saving the boot.ini file, use the ATTRIB command before/after editing the file, to clear/restore any system, hidden and read-only file attributes.


Right click on "My Computer", choose Properties. Tab Advanced, Start up and Recovery Settings Button. There's an Edit button which will take you directly to boot.ini.


----------



## centurion (Mar 17, 2009)

It't my output fdisk:

*The data for partition 1 is:
sysid 15(0xaf), (Extended DOS (LBA))
  start 188934480, size 436206960 (212991 Meg), lag 0
    beg: cyl 10023/ head 255/ sector 63;
    end: cyl 1023/ head 64/ sector 63
The data for partiton 2 is:
sysid 165 (0xa5), (FreeBSD/NetBSD, 386BSD)
  start 63, size 188924337 (92248 Meg), flag 80 (active)
    beg: cyl 0/ head 1/ sector 1;
    end: cyl 1023/ head 254/ sector 63;
The data for partiton 3 is:
<UNUSED>
The data for partiton 4 is:
<UNUSED>*

Can it be problem that I have no connection to the Internet ?


----------



## ale (Mar 17, 2009)

centurion said:
			
		

> *Djn* and *ale* I'll check it out later(I'll write back tommorow, becouse now I haven't access to my laptop - don't ask why )


Sorry if I'm giving you a delusion, but what I wrote is just to let sysinstall write on your disk, obviously it will not fix winxp by itself.
I'd try restoring the winxp mbr using the install cd (don't ask me how, but I'm pretty sure it's possible, try looking in ms sites/forums). Then try to boot using the windows bootloader as mickey said.


----------



## SirDice (Mar 17, 2009)

Looks like your windows is installed in an extended DOS partition. And it also looks like the bootmgr can't really deal with that 

It should all still be there though 

If you boot the winXP install CD you can choose the recovery option. You will need to enter your administrator's password. The FIXMBR command will restore the default windows boot record. There's also the FIXBOOT command but you probably don't need that.


----------



## mickey (Mar 18, 2009)

centurion said:
			
		

> The data for partition 1 is:
> sysid 15(0xaf), (Extended DOS (LBA))
> start 188934480, size 436206960 (212991 Meg), lag 0
> beg: cyl 10023/ head 255/ sector 63;
> end: cyl 1023/ head 64/ sector 63



In that case you might want to re-install Windows XP anyways, and this time make it a primary partition and select NTFS as the filesystem type. Then follow the instructions for configuring the Windows XP bootloader to boot FreeBSD, too. And while you are at it, you might also want to install the Recovery Console, as described here: http://support.microsoft.com/kb/307654


----------



## centurion (Mar 18, 2009)

Thanks guys for all ;p I'll fight with it myself


----------

