Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Nov 2012 20:59:16 +0100
From:      Damien Fleuriot <ml@my.gd>
To:        "Lucas B. Cohen" <lbc@bnrlabs.com>
Cc:        Ralf Mardorf <ralf.mardorf@rocketmail.com>, "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: Multi-boot Linux + FreeBSD
Message-ID:  <EB5A2676-FA63-4039-9082-83FDE7FC0805@my.gd>
In-Reply-To: <50B0FF17.8050309@bnrlabs.com>
References:  <1353773206.4982.20.camel@q> <50B0FF17.8050309@bnrlabs.com>

next in thread | previous in thread | raw e-mail | index | archive | help
While no expert, I would advise against running the kernel directly.

The loader allows you to boot in single user which may come handy at times.


On 24 Nov 2012, at 18:08, "Lucas B. Cohen" <lbc@bnrlabs.com> wrote:

> Hi Ralf,
>=20
> On 2012.11.24 17:06, Ralf Mardorf wrote:
>> Perhaps later today I'll install 9.0 amd64. If possible I'll keep my
>> Linux GRUB legacy. Can I use my menu.lst [1] and add a chainloader or
>> something similar to boot FreeBSD from /dev/sda1?
> I don't know if GRUB v1 allows that, on a multiboot system I use GRUB 2
> to either load FreeBSD's loader(8) :
>=20
> menuentry "FreeBSD (Loader)" {
>        insmod part_bsd
>        set root=3D'hd0,msdos2,bsd1'
>        echo "Loading FreeBSD loader"
>        kfreebsd /boot/loader
>        echo "Starting FreeBSD loader"
> }
>=20
> or to run its kernel directly, after having passed it optional device hint=
s:
>=20
> menuentry "FreeBSD (Direct Boot)" {
>        insmod ufs2
>        set root=3D'hd0,msdos2,bsd1'
>        echo "Loading FreeBSD kernel"
>        kfreebsd /boot/kernel/kernel
>        echo "Loading FreeBSD environment"
>        kfreebsd_loadenv /boot/device.hints
>        set kfreebsd.vfs.root.mountfrom=3Dufs:/dev/ada0s2
>        echo "Booting FreeBSD"
> }
>=20
> I'm not saying it's impossible, but I'm unable to chainload to the
> loader code on my system with this:
> menuentry "FreeBSD (Chainload)" {
>        insmod chain
>        set root=3D'hd0,msdos2'
>        chainloader +1
> }
>=20
>=20
>=20
>> FWIW I made backups of my HDD's MBRs.
>> I wonder if the installer will overwrite the MBR?
> Always a good thing to have backups. =46rom what I've experienced and
> read, 9.0-RELEASE's installer is not always predictable in that regard,
> it's probably safer to assume it'll won't do what you want, and just
> restore your MBR after the installation, to go back to using GRUB for
> dual-booting.
>=20
> Here's the pitfall, though: the MBR also holds the partition table. So
> make a fresh backup after you've created/reorganized the primary
> partitions (slices) on your disk using a tool you're familiar with.
> (Logical partitions and BSD partitions are stored differently, so they
> will survive an MBR restore, provided it doesn't modify the primary
> partition they're contained in.)
>=20
>> I also would like to know, if there's a way to recover the partition
>> table, including a primary FreeBSD partition/slice, if this ever should
>> get broken and there should be no backup of the partition table be
>> available.
> The partition table is held alongside the MBR, in the first logical
> sector of your disk. Restoring one will restore the other.
> For extra safety, you can save the output of partitioning tools like
> fdisk or GNU parted expressed in sectors.
>=20
> Hope this helps,
>=20
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.or=
g"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EB5A2676-FA63-4039-9082-83FDE7FC0805>