Jump to content











Photo
- - - - -

OpenBSD vs Windows 7 Dual boot


  • Please log in to reply
26 replies to this topic

#1 mbzadegan

mbzadegan

    Frequent Member

  • Advanced user
  • 105 posts
  • Location:IFN
  •  
    Canada

Posted 26 June 2015 - 01:36 AM

Hi every body,

I installed windows 7 on my HDD and then install OpenBSD to a free partition of my HDD.

Now, I can boot only to Windows 7.

I did the steps of http://cromwell-intl...indows-openbsd/but nothing changed and I can not boot to my OpenBSD by bcdedit.

Also when I boot from a live cd I can boot forward to my OpenBSD but I want to create a boot menu to select which OS booting.

So, Which tools can install on my HDD to perform the boot selection menu?

Thanks.



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 June 2015 - 08:28 AM

Well, this part:

The old C:\boot.ini configuration file for the NTLDR boot loader disappeared after Windows XP.

 

of the mentioned article is wrong (though the truth is a little known piece of info).

 

The BOOTMGR does parse directly the BOOT.INI and adds seamlessly all entries that are NOT ArcPaths (i.e. it adds only bootsectors to be chainloaded) to the BOOTMGR menu of choices, see here (only seemingly unrelated):

http://www.msfn.org/...g-dos-and-win7/

http://reboot.pro/to...-results/page-2

http://www.msfn.org/...ager-installer/

 

 

 

You can have a BOOT.INI with these contents:

 

[boot loader]
Timeout=10
default=C:\boot\openbsd.pbr
[operating systems]
C:\boot\openbsd.pbr="My nice OpenBSD"

 

At least for testing , it is much easier.

 

:duff:

Wonko



#3 mbzadegan

mbzadegan

    Frequent Member

  • Advanced user
  • 105 posts
  • Location:IFN
  •  
    Canada

Posted 27 June 2015 - 11:25 AM

Dear Wonko,

I created a BOOT.INI file in C:\ with your suggested content but nothing changed.

Is there other resolve way to dual booting Windows7 with OpenBSD?



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 June 2015 - 10:25 AM

Dear Wonko,

I created a BOOT.INI file in C:\ with your suggested content but nothing changed.

Is there other resolve way to dual booting Windows7 with OpenBSD?

Well, IF the BOOTMGR boots, THEN it will parse the contents of BOOT.INI, i.e. at least you should have an added entry in the boot menu for "My nice OpenBSD", of course the file C:\boot\openbsd.pbr needs to exist and it needs to be a copy of a valid PBR to go further.

Try adding to the root of the C: a grldr from grub4dos and add to boot.ini a line:

C:\grldr="grub4dos"

You should now have two added choices at boot time, one "My nice OpenBSD" and one "grub4dos", and if you choose the latter you should get to the grub4dos prompt.

 

Is it not that you are using a UEFI (as opposed to BIOS) machine?

 

How EXACTLY did you create the openbsd.pbr file?

 

Are you sure you have an A6 type partition?

...

 

Since it is not the first time that I have to apply (light) forms of torture :w00t: :ph34r: to wring from you the needed basic info that you should have posted on first instance, it would be nice if you could provide the Standard Litany:

http://homepage.ntlw...ard-litany.html

 

"it doesn't work", "nothing changed", etc. do not provide enough info to help understand what may be the issue, try describing what you did, and what is actually happening

 

:duff:

Wonko



#5 mbzadegan

mbzadegan

    Frequent Member

  • Advanced user
  • 105 posts
  • Location:IFN
  •  
    Canada

Posted 28 June 2015 - 11:53 AM

My boot.ini contain:

 

[boot loader]
timeout=10
default=c:\openbsd.pbr
[operating systems]
c:\openbsd.pbr="OpenBSD"
c:\grldr="grub4dos"
 
I create the openbsd.pbr with dd if=/dev/rsd0a of=/mnt/openbsd.pbr bs=512 count=1
when I booting I have 3 choices:
1.windows7
2.OpenBSD
3.grub4dos
 
choice 1 worked correctly.
choice 2 hanged on:
Loading.....
ERR M
choice 3 hanged on bcdedit warning on missing or curropting of /grldr!
 
BTW: I have 64bit windows version and grub4dos or grldr did not worked correctly by 64 bit OS and I set type A6 for OpenBSD partition.

Edited by mbzadegan, 28 June 2015 - 12:06 PM.


#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 June 2015 - 01:54 PM

There is nothing connected with 32 or 64 bit and grub4dos.
grub4dos' grldr loads outside any specific 32 or 64 bitness of the Windows OS used.
 
Is the grldr there?
Which version is it?
 
Can you boot the bsd with ?:
 

If we need to get into the OpenBSD side of things right away, we can boot from the installation CD and type:
 

b sd0a:/bsd


Please note how the official BSD documentation has to say:
http://www.openbsd.o...ml#Multibooting
 

To multiboot with NT, you need a copy of your OpenBSD Partition Boot Record (PBR). After running installboot, you can copy it to a file using dd(1), following a process similar to:
# dd if=/dev/rsd0a of=openbsd.pbr bs=512 count=1
Note: this is a really good time to remind you that blindly typing commands in you don't understand is a really bad idea. This line will not work directly on most computers. It is left to the reader to adapt it to their machine.


It is entirely possible that your dd command is not adequate to the setup you created, if you manage to get to the grub4dos prompt you can try to directly chainloading the PBR and see if that works (and then the issue is with contents of openbsd.pbr) or if something else is the issue.

:duff:
Wonko

#7 mbzadegan

mbzadegan

    Frequent Member

  • Advanced user
  • 105 posts
  • Location:IFN
  •  
    Canada

Posted 28 June 2015 - 02:17 PM

There is nothing connected with 32 or 64 bit and grub4dos.
grub4dos' grldr loads outside any specific 32 or 64 bitness of the Windows OS used.
 
Is the grldr there?
Which version is it?
 
Can you boot the bsd with ?:
 

Please note how the official BSD documentation has to say:
http://www.openbsd.o...ml#Multibooting
 

It is entirely possible that your dd command is not adequate to the setup you created, if you manage to get to the grub4dos prompt you can try to directly chainloading the PBR and see if that works (and then the issue is with contents of openbsd.pbr) or if something else is the issue.

:duff:
Wonko

 

My grldr version is the version of grub4dos0.4.4 that last modified 3/31/2009.

Yes, I can boot my OpenBSD with Installer CD and b sd0a:/bsd command.

Yes, I'm trying to run at least Grub4Dos to chainloading into OpenBSD But Still I get grldr missing or curropt warning!

BTW, I run the official Grub4Dos in my 64bit windows and it error me:

 

The version of this file is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need an x86 (32Bit) or x64 (64-bit) version of the program.



#8 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 28 June 2015 - 02:33 PM

Only 0.4.5c and later versions of grldr can be loaded by bootmgr.

You cannot succeed with old versions.

#9 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 June 2015 - 02:41 PM

You cannot "run" grub4dos (no matter if "official" or "unofficial") under *any Windows*[1].
 
Version 0.4.4 2009-03-31 is a very old and outdated version of grub4dos, which was NEVER recommended.
 
And I already made you aware of this, some 4 (four) years ago:
http://reboot.pro/to...ive-in-windows/
and you were already suggested to check the thread where we keep some links to where latest builds can be found:
http://reboot.pro/topic/14-grub4dos/

Now get latest version of the 0.4.5 branch of grub4dos, from here:
http://grub4dos.chen...ories/downloads
http://grub4dos.chen....5c-2015-05-18/
http://dl.grub4dos.c...c-2015-05-18.7z

Open the archive with 7-zip and from it just extract the grldr file to the root of your C: drive and try again.

:duff:
Wonko

 

[1]Here *any Windows* means any NT based Windows, grub.exe (which is one among the various files that compose the grub4dos release) is a 16 bit DOS executable (and at the same time a Linux excutable) that can be actually run on Windows 95/98/Me which are DOS based.

Specifically mbzadegan is running a Windows 7 64 bit that more generally has removed support for 16-bit executables.



#10 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 June 2015 - 02:41 PM

Double post, please ignore-



#11 mbzadegan

mbzadegan

    Frequent Member

  • Advanced user
  • 105 posts
  • Location:IFN
  •  
    Canada

Posted 29 June 2015 - 04:25 AM

OK,

Yesterday I used SourceForge suggestion http://sourceforge.n...files/GRUB4DOS/.

With your new release of grldr I can forward to grub4dos from bootmgr.

BUT, When I select the OpenBSD choice it error me:

 

Error 17:(http://grub4dos.chenall.net/e/17)

              Cannot mount selected partition

Press any key to continue...


Edited by mbzadegan, 29 June 2015 - 04:39 AM.


#12 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 29 June 2015 - 05:05 AM

You might have specified an invalid/nonexistent partition.

#13 mbzadegan

mbzadegan

    Frequent Member

  • Advanced user
  • 105 posts
  • Location:IFN
  •  
    Canada

Posted 29 June 2015 - 06:35 AM

No,

If I specified an invalid/nonexistent partition, the Error 22 (No such partition) would be displayed!



#14 mbzadegan

mbzadegan

    Frequent Member

  • Advanced user
  • 105 posts
  • Location:IFN
  •  
    Canada

Posted 29 June 2015 - 06:37 AM

You might have specified an invalid/nonexistent partition.

 

No,

If I specified an invalid/nonexistent partition, the Error 22 (No such partition) would be displayed!

Sorry for dual post.


Edited by mbzadegan, 29 June 2015 - 06:39 AM.


#15 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 29 June 2015 - 08:16 AM

The filesystem not recognized by grub4dos?

 

Which file system type?

 

You might want to use Ext2/3 for compatibility.

 

If you use ext4, you may try grub4dos 0.4.6a.

 

Use this command:

 

geometry (hd0)

 

to get a partition list of drive (hd0).



#16 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 29 June 2015 - 08:40 AM

I suggest you use grub4dos 0.4.6a 2015-06-05  (this is the version I have thoroughly tested and use)

http://grub4dos.chen...ries/downloads/



#17 mbzadegan

mbzadegan

    Frequent Member

  • Advanced user
  • 105 posts
  • Location:IFN
  •  
    Canada

Posted 29 June 2015 - 09:52 AM

As I told in post #1 I used A6 OpenBSD partition type.


Edited by mbzadegan, 29 June 2015 - 09:53 AM.


#18 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 29 June 2015 - 09:53 AM

There are no issues (yet) with recognizing or mounting a partition, all it is needed is to chainload a PBR, NOT anything else.
We are talking of BSD here, the setup is (slightly) different from other more common OS:
http://www.openbsd.o...aq14.html#intro
 
 
 
What is needed is (when booted in OpenBSD, the output of:
fdisk sd0
and then the same (as tinybit suggested) from grub4dos using the geometry command.
 
 
I also wonder WHICH "OpenBSD choice" mbzadegan chose. :unsure:
With just grldr in the root of C:\ one should get to the grub command line.
Say that like in the tutorial originally cited the OpenBSD os the third partition (aka (hd0,2)) what one needs to try at the grub4dos prompt is:
chainloader (hd0,2) +1
that is directly chainload the PBR of that partition (as opposed to the copy openbsd.pbr).
 
Additionally ERR M more or less means that the pbr points to a wrong location for the second stage boot file:
http://www.openbsd.o...sec=8&arch=i386
 

ERR M
Bad magic. The ELF “magic number” \7fELF in boot(8)'s header was not found. This indicates that the first block of boot(8) was not read correctly. This could be due to disk corruption, failing to run installboot(8), giving an invalid boot(8) program as the boot argument to installboot(8), or incorrect geometry translation.

 
:duff:
Wonko
  • mbzadegan likes this

#19 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 29 June 2015 - 10:38 AM

As I told in post #1 I used A6 OpenBSD partition type.

You mean Hex ID A6? Grub4DOS usually will ignore the partition ID. The ID is not significant. Only the volume's filesystem type(name) matters.

You may consider Wonko's suggestion.
 

c:\openbsd.pbr="OpenBSD"
............................
choice 2 hanged on:
Loading.....
ERR M


It seems you did not have a working openbsd.pbr. I mean the boot sector code in openbsd.pbr must be buggy. You should report the problem to the development team of OpenBSD.



#20 mbzadegan

mbzadegan

    Frequent Member

  • Advanced user
  • 105 posts
  • Location:IFN
  •  
    Canada

Posted 29 June 2015 - 11:47 AM

Yes, The OpenBSD partition type ID is A6.

 

fdisk sd0 reported : http://pasteboard.co/1AcYChcY.jpg

chainloader (hd0,2) +reported : http://pasteboard.co/1Ad2n2xL.jpg



#21 mbzadegan

mbzadegan

    Frequent Member

  • Advanced user
  • 105 posts
  • Location:IFN
  •  
    Canada

Posted 29 June 2015 - 12:10 PM

 I mean the boot sector code in openbsd.pbr must be buggy. 

Also, I recreated this file but the issue was repeat!



#22 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 29 June 2015 - 12:15 PM

Also, I recreated this file but the issue was repeat!


OK, you confirmed the failure of your BSD boot sector code. So it's time for you to submit a bug report to OpenBSD developers.
  • mbzadegan likes this

#23 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 29 June 2015 - 12:39 PM

Yes, The OpenBSD partition type ID is A6.

fdisk sd0 reported : http://pasteboard.co/1AcYChcY.jpg
chainloader (hd0,2) +1 reported : http://pasteboard.co/1Ad2n2xL.jpg


There shouldn't be any space between (hd0,2) and +1. Besides, the partition number of your BSD does not have to be 2. You should use the correct number for the partition.
  • mbzadegan likes this

#24 mbzadegan

mbzadegan

    Frequent Member

  • Advanced user
  • 105 posts
  • Location:IFN
  •  
    Canada

Posted 29 June 2015 - 12:46 PM

OK, Thanks alot.

My Issue was resolved with chainloader (hd0,2)+1.



#25 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 29 June 2015 - 01:35 PM

OK, Thanks alot.
My Issue was resolved with chainloader (hd0,2)+1.

And thank you for your feed-back about the success.

You may consider to continue the report to BSD developer about the "openbsd.pbr" boot sector failure when it is used in BOOT.INI.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users