From owner-freebsd-fs@FreeBSD.ORG Sun Jan 22 12:26:09 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 999411065670 for ; Sun, 22 Jan 2012 12:26:09 +0000 (UTC) (envelope-from freebsd-fs@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE438FC08 for ; Sun, 22 Jan 2012 12:26:09 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RowUp-00082D-VF for freebsd-fs@freebsd.org; Sun, 22 Jan 2012 13:26:07 +0100 Received: from 78-86-4-158.zone2.bethere.co.uk ([78.86.4.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 22 Jan 2012 13:26:07 +0100 Received: from johannes by 78-86-4-158.zone2.bethere.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 22 Jan 2012 13:26:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-fs@freebsd.org From: Johannes Totz Date: Sun, 22 Jan 2012 12:25:54 +0000 Lines: 46 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 78-86-4-158.zone2.bethere.co.uk User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 In-Reply-To: Subject: Re: Booting from zfs snapshot X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 12:26:09 -0000 On 19/01/2012 16:26, Andreas Nilsson wrote: > Hello, > > I'm trying to wrap my head around the process of booting from a zfs > snapshot. I have hit a few roadblocks, which I hope this is the adequate > list to post to regarding those. > > A short note on what I'm trying to achieve might be in order. In short: a > nanobsd system on zfs only. I want to boot from a snapshot so that when I > push out an upgrade with zfs send, I want the root filesystem to remain > unchanged. > > The problems I've hit so far: > *1 Making the zpool.cache file available > *2 Having / mount via entry in fstab. FWIW, I dont use any fstab for my zfs-only machine. Works perfectly fine with mountpoint property. > *1: The zpool.cache is needed to autoimport a pool as I understand it. Is > there a way to force the kernel to import a pool during bootup even though > no zpool.cache is around? What does this file actually contain? > > I made an experiment and booted a disk with zfs root from machine a in > machine b and that worked. I did partition the disk with gpart using a gpt > scheme, and labeled the partition on which the pool resides as os, and upon > creation of the zpool used gpt/os as device. Does this mean that as long as > gpt/os is available, any machine boot this disk will have the zpool > autoimported? Not quite sure I understand you here. Just a note: booting kernel and mounting root fs are two different things. the *zfsloader will happily load the kernel off a pool and boot it but mounting root might fail later (I guess if no cachefile is present?). > > *2: Having a line like > tank/root/8.2-RELEASE-p5@ro / zfs ro 0 0 > in fstab causes mount to throw an error and leave me in single user mode, > when the system is booted however mount can mount a zfs snapshot just fine. > Setting vfs.root.mountfrom in loader.conf works just fine though. -- Sent from my