Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jun 2011 20:28:52 +0200
From:      Gyrd Thane Lange <gyrd-se@thanelange.no>
To:        perryh@pluto.rain.com
Cc:        doug@safeport.com, freebsd-questions@freebsd.org
Subject:   Re: Dual Boot 8.2 and Windows 7
Message-ID:  <20110626202852.6765f935@parvati.thanelange.no>
In-Reply-To: <4e05220e.GBAaOafCcTgMjymv%perryh@pluto.rain.com>
References:  <alpine.BSF.2.00.1106231919320.83085@oceanpt.safeport.com> <D7EC3198-B917-4ACB-9BC2-ACE6D5569C07@my.gd> <4D7F86D5012E084A@> <alpine.BSF.2.00.1106240933580.83085@oceanpt.safeport.com> <4e05220e.GBAaOafCcTgMjymv%perryh@pluto.rain.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 24 Jun 2011 16:47:26 -0700
perryh@pluto.rain.com wrote:

> doug@safeport.com wrote:
> 
> > If FreeBSD can be installed in an extended partition,
> > that would be a very useful howto.
> 
> _Installing_ it in an "extended partition" is easy enough.
> geom(8) understands "extended partitions" (although sysinstall
> does not, so you need to install using Fixit# as for other
> non-sysinstall cases such as ZFS).
> 
> The problem is _booting_ it.  The code in i386/boot2 and
> lib/libstand is written to find the / (or /boot) FS on a
> BSD partition of an fdisk "primary partition" (aka slice),
> or in a GPT partition, and would need additions to handle
> fdisk "extended partitions".

Some years ago I ran into a similar problem. I ran out of primary
partitions (using MBR-speak) and had to move FreeBSD into an extended
partition.

Here the simple patch I wrote for the FreeBSD boot loader:
<http://parvati.thanelange.no/freebsd/boot_loader/boot_loader.diff>;
<http://parvati.thanelange.no/freebsd/boot_loader/>;

To update your source use:

patch -d /usr/src/sys/boot/i386/libi386/ < boot_loader.diff

The FreeBSD loader has since a very long time ago attempted to work
with MBR extended partitions but a simple logical error has prevented
it from succeeding:

How it normally works.

-----
| 1 |
-----
| 2 | --
-----   |
        |
        |
        |
----- <-
| 5 |
-----
|   | --
-----   |
        |
        |
        |
----- <-
| 6 |
-----
|   |
-----


How /boot/loader (incorrectly) works.

-----
| 1 |
-----
| 2 | --
-----   |
        |
        |
        |
----- <-
| 5 |
-----
| 6 | --
-----   |
        |
        |
        |
----- <-
| 7 |
-----
| 8 |
-----


It has been a long time since I installed my system but I seem to
remember that all that is required is to copy the /boot/loader binary
from a patched system onto the newly installed one. (I have included a
copy of my /boot/loader at the URL above.)

The next challenge is to find a boot manager that will pick up FreeBSD
in an extended partition. For myself I use a self patched GRUB. (GRUB
also nearly worked out of the box, but had a different problem.) You're
welcome to have those patches as well if you need them.

Lastly I have the following in my kernel configuration file:

include GENERIC
...
nooptions         GEOM_PART_BSD
nooptions         GEOM_PART_MBR
options           GEOM_BSD
options           GEOM_MBR

That is because I am not fond of the new mangled device names, but
prefer the old ones.

Hope any of this helps.
Best regards,

Gyrd ^_^



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