From owner-freebsd-stable@freebsd.org Fri Jan 13 20:40:18 2017 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2418CAE723 for ; Fri, 13 Jan 2017 20:40:18 +0000 (UTC) (envelope-from jlehen@gmail.com) Received: from mail-vk0-x244.google.com (mail-vk0-x244.google.com [IPv6:2607:f8b0:400c:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4171A3B for ; Fri, 13 Jan 2017 20:40:18 +0000 (UTC) (envelope-from jlehen@gmail.com) Received: by mail-vk0-x244.google.com with SMTP id 23so4588450vkc.2 for ; Fri, 13 Jan 2017 12:40:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=wMPrQifEYljP26eH44RrEIbTQaM88y2JLOwa50HAHw4=; b=k6DOSxZNPzdVQlf2pqn66PWwNRuiF0Vrp/sGwCGUhvxIjLiv0x8XsT6Ge9+cYj3YZb 0HqBVuUNwlmmLPuWh3wVyvF6UTtdid5179dAsylI6L9KMwVjOUSRaEFHD9i14yTHWjCT pYoWWnHm51Wml1ngftMxFkni8Y9pvp5FLvVmlnuVJkflH5Mei5i/1SUn6KMkKN0eLeU0 /K8iXFvQ9W5nV/ahph+jupDslROJ7rltHt7XtLcWjUwwtKQjpDZnALXO7tICGV6zf375 p4DjiJPVsg9BgEO44mNMUe+gqURcY79E8Ro9xC1IMJO0t+4pDXIfRq/vnVgbHIfyHquG pxLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=wMPrQifEYljP26eH44RrEIbTQaM88y2JLOwa50HAHw4=; b=I9X40yv1ZMrM1aA+wAJcr97lPO0R7D3lUekwFBUpq9OncSotNptl+dOinIqe6zVj/8 Mcb5Kp85RTKbHJiVAprABp1ws4QGbqjsfnsoqVHLLcdN4jB4r5QMC/xjGaUQI8CsR71b B7t9asOF6oztCh2jmwxIUfks1juFVQgRIdQ2HM2bZPvePi9zD3UKp3uJZbkO7o9D5Pha qfbdZUhfzfJz7WkGQTuqWAJ4YcRMvFI+1INBk2xqX0lj7FpMgXGVRiQ5Dou1BSBeV5gu gBTcg3/zKfdjSUnjMYEK44UQih/N+I1F2C6kloBlL/9XOeCAyQ2EKVtH1AFwvQhhHaLC O+/w== X-Gm-Message-State: AIkVDXKANrmOb9dVtZMXVkDPJdHt6/bl8ZTS15A7BoF5nTYM6WK67IntUcJugp+i1TT1m1NzTDY/GP6sZrMb3A== X-Received: by 10.31.63.133 with SMTP id m127mr10873916vka.42.1484340016852; Fri, 13 Jan 2017 12:40:16 -0800 (PST) MIME-Version: 1.0 Sender: jlehen@gmail.com Received: by 10.103.13.5 with HTTP; Fri, 13 Jan 2017 12:40:16 -0800 (PST) In-Reply-To: References: From: Jeremie Le Hen Date: Fri, 13 Jan 2017 21:40:16 +0100 X-Google-Sender-Auth: jYBB5eCj1OWB1CZUWtjxRuhGVbE Message-ID: Subject: Re: Can't boot on ZFS -- /boot/zfsloader not found To: Steven Hartland Cc: freebsd-stable@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 20:40:18 -0000 On Thu, Jan 12, 2017 at 10:55 PM, Steven Hartland wrote: > On 12/01/2017 21:12, Jeremie Le Hen wrote: > > Hey Steven, > > (Please cc: me on reply) > > On Thu, Jan 12, 2017 at 1:32 AM, Steven Hartlan > > The reason I'd recommend 512k for boot is to provide room for expansion > moving forward, as repartitioning to upgrade is a scary / hard thing to do. > Remember it wasn't long ago when it was well under 64k and that's what was > recommend, its not like with disk sizes these days you'll miss the extra > 384k ;-) > > Yeah, that's wise you're right. > > Boot to a live cd, I'd recommend mfsbsd, and make sure the boot loader was > written to ALL boot disks correctly e.g. > if you have a mirrored pool with ada0 and ada1: > gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0 > gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0 > > If this doesn't help the output from gpart show, uname -a and zpool status > would also be helpful. > > This is all assuming standard BIOS mode and not UEFI which is done > differently. > > I just use the installation media on an USB key and then drop to the > shell. This is a full FreeBSD running, so that's fine. > > % # gpart show ada0 > % => 40 312581728 ada0 GPT (149G) > % 40 1024 1 freebsd-boot (512K) > % 1064 8387840 2 freebsd-swap (4.0G) > % 8388904 304192864 3 freebsd-zfs (145G) > % > % # uname -a > % FreeBSD 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep > 29 01:43:23 UTC 2016 % % > root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 > % > % # zpool status > % pool: zroot > % state: ONLINE > % scan: none requested > % config: > % > % NAME STATE READ > WRITE CKSUM > % zroot ONLINE 0 > 0 0 > % gptid/1c387d3b-d892-11e6-944b-f44d30620eeb ONLINE 0 > 0 0 > % > % errors: No known data errors > > Here are the steps to write the bootloader: > > % # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0 > % partcode written to ada0p1 > % bootcode written to ada0 > % # zpool get bootfs zroot > % NAME PROPERTY VALUE SOURCE > % zroot bootfs zroot local > > Two things spring to mind > > Idea 1: > Is your root fs actually your direct pool or is it actually /root off your > pool. > If so you want to run: > zpool set bootfs=zroot/root zroot That was it. My boot volume is "zroot/root" and I was just following brainlessly the doc which said to use "zroot". This didn't shock me because this at least points to the right pool > > Idea 2: > You mentioned in your original post and you used zfs send / recv to restore > the pool, so I wonder if your cache file is out of date. > > Try the following: > zpool export zroot > zpool import -R /mnt -o cachefile=/boot/zfs/zpool.cache zroot > cp /boot/zfs/zpool.cache /mnt/boot/zfs/zpool.cache > zpool set bootfs=zroot/root zroot I think that was wrong too, but this would probably have caused problems later in the boot I think. Anyway, thanks a lot for your help. I'll give a quick lifting to the wiki page. -jlh > > Regards > Steve -- Jeremie Le Hen jlh@FreeBSD.org