Questions about FreeBSD and Linux on the same disk

jhell jhell at DataIX.net
Sat Aug 28 08:55:26 UTC 2010


On 08/26/2010 20:10, Matthew Jacob wrote:
> 
> Umm. I don't do much with the extended partitions, but I certainly have
> more than one FreeBSD system on the box- two on drive 0 and one on drive 2.
> 
> title Fedora (2.6.32.16-141.fc12.x86_64)
>         root (hd0,0)
>         kernel /vmlinuz-2.6.32.16-141.fc12.x86_64 ro
> root=/dev/mapper/VolGroup-lv_root console=ttyS0,115200n8
> SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=us
>         initrd /initramfs-2.6.32.16-141.fc12.x86_64.img
>         savedefault
> ...
> title FreeBSD
>         rootnoverify (hd0,2)
>         makeactive
>         chainloader +1
>         savedefault
> title FreeBSD32
>         rootnoverify (hd0,1)
>         makeactive
>         chainloader +1
>         savedefault
> title FreeBSD32 8.X
>         rootnoverify (hd2,0)
>         makeactive
>         chainloader +1
>         savedefault
> ....
> 
>> above it sounds like you have the "multiple freebsd" problem licked,
>> perhaps you could take a look at my post on -hackers and help me out
>> there too?  :-/
>>
>>

Something you may also find of interest is the ``map'' command in grub
that allows you to remap where drives are before you boot as well hide
other drives so certain OS's can't see them. Explained in the grub info
page.

What I did with it....

Since I like the thought of Windows not being able to touch my FreeBSD
install (mbr) and that I like my FreeBSD install to be on the first disk
of the machine for sanity reasons.

My install was like this. (from empty disks to multi-booting).
* Install FreeBSD as usual on disk0 partitions however you create them.
* (Optional) install additional FreeBSD's or Linux versions on other
partitions.
* Install grub from one of the above installs to disk0's mbr.
* Time to install Windows! (Eeeek!) turn off disk0 in the bios so the
machine & Windows can not see it. This way it thinks disk1 is disk0 and
will install as such. Also installing its mbr/bootmbr to disk1 and not
disk0.
* After the install and update of your installed Windows onto disk1 pop
back into the bios and turn disk0 back on or plug it back in or reverse
whatever you have done before.
* When your computer reboots after you re-enabled disk0 it will boot up
to grub and allow you to boot into FreeBSD or Linux whatever you choose
from the first 3 steps.
* Now effectively what you have is two ways to boot either disk0 or
disk1 using grub to boot either. And if disk0 fails then your
installation will fail-over to disk1 and boot Windows without intervention.
* Next step is to boot to the grub command line after editing your grub
config for convienience, and add a section for your windows install that
you can add commands to later on after testing.
* Boot to the grub command line hit ``e'' on the Windows label to edit
and ``a'' to add a entry to contain something like ``map (ad0) (ad1)''
and then repeat for an addition of another line below that ``map (ad1)
(ad0)'' then use ``b'' to try to boot into Windows.
* Once you find the right commands through testing jot them down and
boot into where your grub config is and edit to your liking.
* When you boot back into windows the next time you can turn off your
actual disk0 from the Device Manager and be sure that windows will never
touch it again.

With this type of install you always have a OS that can boot without the
need for pulling out some rescue disk and can be sure that one risky OS
like Windows will not touch the MBR of another OS.


PS: I am looking for my exact configuration used and if found I will
post back.

Regards,

-- 

 jhell,v


More information about the freebsd-fs mailing list