From owner-freebsd-questions@FreeBSD.ORG Fri Jan 22 05:02:54 2010 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 EA06A106566B; Fri, 22 Jan 2010 05:02:54 +0000 (UTC) (envelope-from dan.naumov@gmail.com) Received: from mail-yx0-f171.google.com (mail-yx0-f171.google.com [209.85.210.171]) by mx1.freebsd.org (Postfix) with ESMTP id 923C58FC17; Fri, 22 Jan 2010 05:02:54 +0000 (UTC) Received: by yxe1 with SMTP id 1so677206yxe.3 for ; Thu, 21 Jan 2010 21:02:53 -0800 (PST) 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; bh=A2GhY+Mbos8pkVtiDeoMQCNYdQE2+Fu1KhfPkWs1/YQ=; b=I3lH1VyVFy5QD8ZE1o5xBjmPYCkmieKL2Pc5gDx5g1CZuy3D7P8f9cldyIv2SnAY8r oi/lJH+TfYoX5AyVjQKhwj6K0DN5aQoB6PhpBVJDBwbt8fyYdkkVPNL34rIXymglSLbw yDL35E6PEao9hu+zynKtDioeluoAxoaWzM/Ec= 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; b=XnK2ZB3gPfI0Kpd/T7KbZ94dUN51KNuaR85agk4xMXfGmo+Xo251/OTpD55+ibGVJx Dsn4+wqJlNwokRdevR4GodzI/1VkUVkDKzYUL21O4kikILfzsejPYIIon5QMqdlGsNuA pwAFUXzTilZl5RM/HjQwgfhTHOS5RlczwTYQ8= MIME-Version: 1.0 Received: by 10.101.10.24 with SMTP id n24mr3278061ani.78.1264136573668; Thu, 21 Jan 2010 21:02:53 -0800 (PST) In-Reply-To: References: <20100122041237.GA22312@gothschlampen.com> Date: Fri, 22 Jan 2010 07:02:53 +0200 Message-ID: From: Dan Naumov To: "Thomas K." Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD-STABLE Mailing List , freebsd-questions@freebsd.org Subject: Re: Loader, MBR and the boot process 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: Fri, 22 Jan 2010 05:02:55 -0000 On Fri, Jan 22, 2010 at 6:49 AM, Dan Naumov wrote: > On Fri, Jan 22, 2010 at 6:12 AM, Thomas K. wrote: >> On Fri, Jan 22, 2010 at 05:57:23AM +0200, Dan Naumov wrote: >> >> Hi, >> >>> I recently found a nifty "FreeBSD ZFS root installation script" and >>> been reworking it a bit to suit my needs better, including changing it >>> from GPT to MBR partitioning. However, I was stumped, even though I >>> had done everything right (or so I thought), the system would get >>> stuck at Loader and refuse to go anywhere. After trying over a dozen >> >> probably this line is the cause: >> >> dd if=/mnt2/boot/zfsboot of=/dev/"${TARGETDISK}"s1a skip=1 seek=1024 >> >> Unless by "swap first" you meant the on-disk location, and not the >> partition letter. If swap is partition "a", you're writing the loader >> into swapspace. >> >> >> Regards, >> Thomas > > At first you made me feel silly, but then I decided to double-check, I > uncommented the swap line in the partitioning part again, ensured I > was writing the bootloader to "${TARGETDISK}"s1b and ran the script. > Same problem, hangs at loader. Again, if I comment out the swap, > giving the entire slice to ZFS and then write the bootloader to > "${TARGETDISK}"s1a, run the script, everything works. I have also just tested creating 2 slices, like this: gpart create -s mbr "${TARGETDISK}" gpart add -s 3G -t freebsd "${TARGETDISK}" gpart create -s BSD "${TARGETDISK}"s1 gpart add -t freebsd-swap "${TARGETDISK}"s1 gpart add -t freebsd "${TARGETDISK}" gpart create -s BSD "${TARGETDISK}"s2 gpart add -t freebsd-zfs "${TARGETDISK}"s2 gpart set -a active -i 2 "${TARGETDISK}" gpart bootcode -b /mnt2/boot/boot0 "${TARGETDISK}" and later: dd if=/mnt2/boot/zfsboot of=/dev/"${TARGETDISK}"s2 count=1 dd if=/mnt2/boot/zfsboot of=/dev/"${TARGETDISK}"s2a skip=1 seek=1024 Putting the swap into it's own slice and then putting FreeBSD into it's own slice worked fine. So why the hell can't they both coexist in 1 slice if the swap comes first? - Dan Naumov