From owner-freebsd-fs@FreeBSD.ORG Thu Jan 19 16:51:26 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 579511065674 for ; Thu, 19 Jan 2012 16:51:26 +0000 (UTC) (envelope-from andrnils@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id D4DBC8FC16 for ; Thu, 19 Jan 2012 16:51:25 +0000 (UTC) Received: by bkbc12 with SMTP id c12so173291bkb.13 for ; Thu, 19 Jan 2012 08:51:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=MRdE0Rn3xhB9NJJNFeTaMgJ7JOYA7HWSbPLJkBCkIt4=; b=H+Lpur0Emg1l5mh/1qBpI7lV2E+gN8Bm/11fkKmhpgxudowAhwr1E0Pzlh8MoG22cD F1aoRwBYW2x4i0CxF1a7xwfYYRulm/dG9RvYacgOyPH57KCSRHsbrUU9D023SrhFm1xl 8Xza//XSIECqLsqtKXIBtr0U9DgKdj44+l6RU= MIME-Version: 1.0 Received: by 10.205.121.145 with SMTP id gc17mr6128510bkc.23.1326990376923; Thu, 19 Jan 2012 08:26:16 -0800 (PST) Received: by 10.204.40.74 with HTTP; Thu, 19 Jan 2012 08:26:16 -0800 (PST) Date: Thu, 19 Jan 2012 17:26:16 +0100 Message-ID: From: Andreas Nilsson To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: 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: Thu, 19 Jan 2012 16:51:26 -0000 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. *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? *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. Best regards Andreas Nilsson