From owner-freebsd-questions@FreeBSD.ORG Sat Nov 24 17:08:49 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A1FFDE4 for ; Sat, 24 Nov 2012 17:08:49 +0000 (UTC) (envelope-from lbc@bnrlabs.com) Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [IPv6:2a01:e0c:1:1599::12]) by mx1.freebsd.org (Postfix) with ESMTP id 52B468FC12 for ; Sat, 24 Nov 2012 17:08:46 +0000 (UTC) Received: from mail.bnrlabs.com (unknown [82.224.61.5]) by smtp3-g21.free.fr (Postfix) with ESMTP id 72CD0A61A3; Sat, 24 Nov 2012 18:08:40 +0100 (CET) Received: from [127.0.0.1] (unknown [172.20.96.112]) by mail.bnrlabs.com (Postfix) with ESMTP id 2DD8F46072; Sat, 24 Nov 2012 18:08:38 +0100 (CET) Message-ID: <50B0FF17.8050309@bnrlabs.com> Date: Sat, 24 Nov 2012 18:08:39 +0100 From: "Lucas B. Cohen" MIME-Version: 1.0 To: Ralf Mardorf Subject: Re: Multi-boot Linux + FreeBSD References: <1353773206.4982.20.camel@q> In-Reply-To: <1353773206.4982.20.camel@q> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 17:08:49 -0000 Hi Ralf, 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) : menuentry "FreeBSD (Loader)" { insmod part_bsd set root='hd0,msdos2,bsd1' echo "Loading FreeBSD loader" kfreebsd /boot/loader echo "Starting FreeBSD loader" } or to run its kernel directly, after having passed it optional device hints: menuentry "FreeBSD (Direct Boot)" { insmod ufs2 set root='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=ufs:/dev/ada0s2 echo "Booting FreeBSD" } 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='hd0,msdos2' chainloader +1 } > 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. From 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. 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.) > 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. Hope this helps,