From owner-freebsd-questions@FreeBSD.ORG Thu Jul 2 00:52:31 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0F46106564A for ; Thu, 2 Jul 2009 00:52:31 +0000 (UTC) (envelope-from nlandys@gmail.com) Received: from mail-yx0-f181.google.com (mail-yx0-f181.google.com [209.85.210.181]) by mx1.freebsd.org (Postfix) with ESMTP id 6DA968FC08 for ; Thu, 2 Jul 2009 00:52:31 +0000 (UTC) (envelope-from nlandys@gmail.com) Received: by yxe11 with SMTP id 11so1924226yxe.3 for ; Wed, 01 Jul 2009 17:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=pL1nib/hoP+CJ4yJvBEFEkcJ1lKgcDLhrtit3VHrhvs=; b=WlEKCdn3FVGIKSjSDjCWcmx4VbgiVkaukju6SxXKNps5RKXg8WEGsjXUeO9OZbsOks wIK71XZIR4ZsvJDx2knxO+zB94kZwqUJoCaH0scUK/S8r6gBglTGxh8PxeF6qwnx5LP6 2PgNfnXVeC1zylVUWZxNGxsvx04utb6uMn2M8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=vmuysmM52C+Jwf/4isF3+Xt2kV24y5LDQH5gT0CBzMAUrT6tAyLPkGOG/L0eXKPONN ANYpQL0CMbH6qXU6Eie81hkkkeKUQSjVKcNR84rPnxntuSKQtscO9Z5rzF/pdO81YFQY WYCSiAJl2BltcfH2LfMv0geM9XLpAAXqj66nw= MIME-Version: 1.0 Received: by 10.100.241.8 with SMTP id o8mr14382948anh.102.1246495950909; Wed, 01 Jul 2009 17:52:30 -0700 (PDT) In-Reply-To: References: Date: Wed, 1 Jul 2009 17:52:30 -0700 Message-ID: <560f92640907011752h784aab0l2e02c3c28b458685@mail.gmail.com> From: Nerius Landys To: Daniel Underwood Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: boot0 / LILO / GRUB: dual boot FreeBSD and Linux X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2009 00:52:32 -0000 > I'm getting a new desktop through my university which will come > installed with Windows Vista. Obviously, my first action item will be > removing Vista and installing a reasonable OS. Due to the need to be > up-and-running immediately with an OS that I'm comfortable with, I'll > be installing Linux (probably Ubuntu). But I'd like to set-up FreeBSD > also. > > Which of the boot managers do you suggest I use? Which OS should I > install first? Since I've never set-up a FreeBSD/Linux dual-boot > system, I don't know what, if any, pitfalls to avoid. I'm hoping some > of you will have experience I can learn from. Any relevant advice > would be greatly appreciated. > Hi, I'm primarily an Ubuntu Linux user, but I've experimented with FreeBSD desktops and servers quite a bit (servers especially). One thing I found to be really cool is the FreeBSD boot manager. I would strongly recommend using the FreeBSD boot manager because it's completely standalone; it does not depend on any files or data sitting in your partitions. The boot manager sits within the first 512 bytes of your hard drive (the MBR) and it does not need any other data to function. The way it works is simple. Well first a disclaimer. What I describe here, I'm pretty confident that I know what I'm talking about, but there is a chance that my knowledge is wrong. In that case please correct me, someone. The FreeBSD boot manager (I don't know the official name for it off the top of my head), when run, looks at the partitions on the hard drive. It then presents a menu, where you press a function key to select which partition to boot. It basically delegates the booting to the boot record on the partition of your choice. The way to set this up is as follows. Well, I'm sure it's possible to install FreeBSD first and then Linux, but I will describe it the other way. First install Linux normally (well leaving space on your hard drive for a FreeBSD partition, which needs to be primary and not extended). After you install Linux, boot up and do some magic where you install the boot manager (such as Grub or Lilo) onto the boot record of the Linux parttion. Normally the boot manager for Linux will be installed in the MBR, but put it on the partition's boot sector as well. Now install FreeBSD. Install the FreeBSD boot manager. It will not touch the Linux partition at all, the FreeBSD install will only write to the FreeBSD partition and to the MBR. I would not recommend using Grub as a boot manager (for the MBR) because it depends on files sitting on your Linux partition as far as I know. So when you wipe your Linux partition for some reason you won't be able to boot any more. Same goes for Lilo I think. The FreeBSD boot manager does not depend on any data outside of the MBR, so it will continue working properly after you wipe a partition clean. See here: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot-blocks.html It appears that the boot manager is called boot0. If you ever want to back up your MBR for some reason, which includes the partition table and the boot program, you can do something like this: dd if=/dev/hda of=my-mbr-saved-file bs=512 count=1 where "/dev/hda" would be changed depending on OS and hard disk configuration. Then you can restore the MBR: dd if=my-mbr-saved-file of=/dev/hda bs=512 count=1 But restoring should be done with extreme caution because it will rewrite your partition table and could lead to lost data because of that. I have installed the FreeBSD boot manager by using dd after combining the 446-byte long program with an existing partition table