Date: Tue, 2 Aug 2016 17:47:11 +0200 (CEST) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= <Trond.Endrestol@fagskolen.gjovik.no> To: Rares Vernica <rvernica@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: Root on ZFS, FreeBSD and Linux back and forth Message-ID: <alpine.BSF.2.20.1608021733110.43694@mail.fig.ol.no> In-Reply-To: <CALQ9KxCG4s8rP=2SUbHs=eJWn0-BQRzgx%2BGta5Spdh4Esyt4gA@mail.gmail.com> References: <CALQ9KxCG4s8rP=2SUbHs=eJWn0-BQRzgx%2BGta5Spdh4Esyt4gA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2 Aug 2016 08:17-0700, Rares Vernica wrote: > Hello, > > I have two hard drives. One has root-on-ZFS created by FreeBSD (on > installation) and one with Linux. I wonder if it is safe and reliable to > use the root-on-ZFS disk back and forth between FreeBSD and Linux. On Linux > I plan to use ZFS-on-Linux. Both FreeBSD and ZFS-on-Linux seem to use > version 5000. > > To import the zpool in Linux, it seems it needs to be forced. FreeBSD does > not export it on shutdown and I am not sure how or if I should do it. > > How would FreeBSD deal with the zpool if it notices that Linux imported it? > Will FreeBSD force the import on boot? Do I have to take special > precautions for FreeBSD to import the ZFS disk and boot from it once Linux > has touched it? I guess the FreeBSD kernel would refuse to access an exported root pool, leading to a panic à la "mountroot: unable to (re-)mount root.". If you want to share a zpool between FreeBSD and Linux, you should create a dedicated pool. Use custom startup and shutdown scripts for importing and exporting the shared pool on both systems. Be prepared for manual intervention in case of a crash on either system, or craft your scripts to forcefully import the pool if it fails to import on the first attempt. Also, try to keep the enabled features to a minimum. Create the shared pool like this: zpool create -d sharedpool ... Enable only the features you need and supported on both systems. > Also, is ZFS-on-Linux trustworthy enough not to mess up the disk? Don't know. Maybe someone does. -- +-------------------------------+------------------------------------+ | Vennlig hilsen, | Best regards, | | Trond Endrestøl, | Trond Endrestøl, | | IT-ansvarlig, | System administrator, | | Fagskolen Innlandet, | Gjøvik Technical College, Norway, | | tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, | | sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. | +-------------------------------+------------------------------------+ From owner-freebsd-questions@freebsd.org Tue Aug 2 15:57:43 2016 Return-Path: <owner-freebsd-questions@freebsd.org> Delivered-To: freebsd-questions@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 1F27ABAD3AB for <freebsd-questions@mailman.ysv.freebsd.org>; Tue, 2 Aug 2016 15:57:43 +0000 (UTC) (envelope-from jim@ohlste.in) Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (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 CD85F1DCB for <freebsd-questions@freebsd.org>; Tue, 2 Aug 2016 15:57:42 +0000 (UTC) (envelope-from jim@ohlste.in) Received: by mail-qk0-x234.google.com with SMTP id s63so178960067qkb.2 for <freebsd-questions@freebsd.org>; Tue, 02 Aug 2016 08:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ohlste-in.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=BG3urTyyCR9MnD+9lFdL1V8Vh3FsoiBkcxXZQv4NIQk=; b=o3fw3GbN9rJwekXzchMAGzxpKnI/yO67QSTJH+484RdvRf9SVKhEuYbCWadG6F5dZ3 JvwLxLPNxHQd8BkD0Kyf05F1MrNLqwl61/qCC569DIPZ7aRcdASyQCOJ3nFUhOK4dQHX FcXgOFQ1lt3KaphvY3NhgnGBUkmS6FGbrupcQY3J/B/Fjhc6qghvDybepITAjcupVt9u fcM//bhVG7HxWwEZ+YNC0ji47jx6uf+bqC7/QJztD1zb5vz+r5X8kJ5A4+j4RyjaAKam H2wAA/izwjqp7Vcj44YYbWdrX8AjdSpO/edqZc3QwKPOoimsMQJTmi0KJFLhCeRdGwzT 1YCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=BG3urTyyCR9MnD+9lFdL1V8Vh3FsoiBkcxXZQv4NIQk=; b=k1bykDJ42vEwuYF0M6GxkFUF/Yf6Pwisuj4EFI/cNp9SeIiV/nDto1GPKs6m38S8aU YzelvcfmJIRoDIu4h4/5Caa+IulHuVcGxurG0fKenh0AcawZ4tNFkE4n+O7tNNvLnTXA Bx/Q2K1AvkS/FoDgMrikIWyuNhmnA/9FBO3o5GrBhvuzmu41XjnRZicxtBnwgVdSGikN /Lw4BBxghdmfTtnSoWXDS8LLiSTJz1ydelxdVwOOCgiWuUHrJ/iyilZUjME7y+HyGp9V Otbu9BcnqMz2s8uV6hUtXZ4ZF6BHKyNrvQ7cdfFolwgDmjJkNjrS7n26BGnDvgcX0J1A BK8Q== X-Gm-Message-State: AEkoouuwNx11ZL5jO3xvvlybRoBEKurKqNemNH7+MSTNX5j9UFTQALcce1NUVRcUgDEG1g== X-Received: by 10.55.221.18 with SMTP id n18mr32821170qki.142.1470153461585; Tue, 02 Aug 2016 08:57:41 -0700 (PDT) Received: from [192.168.1.4] (pool-108-39-110-225.nrflva.fios.verizon.net. [108.39.110.225]) by smtp.gmail.com with ESMTPSA id 127sm1671521qkk.19.2016.08.02.08.57.40 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Aug 2016 08:57:40 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: Root on ZFS, FreeBSD and Linux back and forth From: Jim Ohlstein <jim@ohlste.in> X-Mailer: iPhone Mail (13G34) In-Reply-To: <alpine.BSF.2.20.1608021733110.43694@mail.fig.ol.no> Date: Tue, 2 Aug 2016 11:57:39 -0400 Cc: Rares Vernica <rvernica@gmail.com>, freebsd-questions@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <A427F3E4-FCD2-4BF1-AF11-CCEB67A9C978@ohlste.in> References: <CALQ9KxCG4s8rP=2SUbHs=eJWn0-BQRzgx+Gta5Spdh4Esyt4gA@mail.gmail.com> <alpine.BSF.2.20.1608021733110.43694@mail.fig.ol.no> To: =?utf-8?Q?Trond_Endrest=C3=B8l?= <Trond.Endrestol@fagskolen.gjovik.no> X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions <freebsd-questions.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/> List-Post: <mailto:freebsd-questions@freebsd.org> List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=subscribe> X-List-Received-Date: Tue, 02 Aug 2016 15:57:43 -0000 Hello, > On Aug 2, 2016, at 11:47 AM, Trond Endrest=C3=B8l <Trond.Endrestol@fagskol= en.gjovik.no> wrote: >=20 >> On Tue, 2 Aug 2016 08:17-0700, Rares Vernica wrote: >>=20 >> Hello, >>=20 >> I have two hard drives. One has root-on-ZFS created by FreeBSD (on >> installation) and one with Linux. I wonder if it is safe and reliable to >> use the root-on-ZFS disk back and forth between FreeBSD and Linux. On Lin= ux >> I plan to use ZFS-on-Linux. Both FreeBSD and ZFS-on-Linux seem to use >> version 5000. >>=20 >> To import the zpool in Linux, it seems it needs to be forced. FreeBSD doe= s >> not export it on shutdown and I am not sure how or if I should do it. >>=20 >> How would FreeBSD deal with the zpool if it notices that Linux imported i= t? >> Will FreeBSD force the import on boot? Do I have to take special >> precautions for FreeBSD to import the ZFS disk and boot from it once Linu= x >> has touched it? >=20 > I guess the FreeBSD kernel would refuse to access an exported root=20 > pool, leading to a panic =C3=A0 la "mountroot: unable to (re-)mount root."= . >=20 > If you want to share a zpool between FreeBSD and Linux, you should=20 > create a dedicated pool. >=20 > Use custom startup and shutdown scripts for importing and exporting=20 > the shared pool on both systems. Be prepared for manual intervention=20 > in case of a crash on either system, or craft your scripts to=20 > forcefully import the pool if it fails to import on the first attempt. >=20 > Also, try to keep the enabled features to a minimum. > Create the shared pool like this: >=20 > zpool create -d sharedpool ... >=20 > Enable only the features you need and supported on both systems. >=20 >> Also, is ZFS-on-Linux trustworthy enough not to mess up the disk? >=20 > Don't know. Maybe someone does. I've used it on a Debian box for a year or so. Just a simple mirrored pool. N= o problems. Have never tried sharing the pool.=20 -- Jim=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.20.1608021733110.43694>