From owner-freebsd-current@freebsd.org Fri Apr 30 14:12:38 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 249D35FFA0A for ; Fri, 30 Apr 2021 14:12:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FWvTK5tpzz4nf3 for ; Fri, 30 Apr 2021 14:12:37 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id CA1D55FFA09; Fri, 30 Apr 2021 14:12:37 +0000 (UTC) Delivered-To: current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9DBB5FFA84 for ; Fri, 30 Apr 2021 14:12:37 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWvTK5Hcvz4nR6; Fri, 30 Apr 2021 14:12:37 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f45.google.com with SMTP id g4-20020a9d6b040000b029029debbbb3ecso31543148otp.7; Fri, 30 Apr 2021 07:12:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Avsr5V82CTp+1tVYoaN4Zun4NVuiuE/CCbLnzBHpWeU=; b=ii571jrJ/q1qyzU0i5G/qPYccesjI4qYnBdF+SwgsRDbDiEfdgU/e5YfjWfdSplmgc tQYBW+dcR9WoNrqDWdYv7WGSMWXqrRpOyc7ANUzPjWLy9OCXruq08ZLnpVvOiaFJEcZg cUq3kYVJ7iRvCqX0v+LfPAth2f+i1m84/js9HlX6BlLURbhQCC+IWqWAqHkrKsDzpfAf BID7VWtIdZov4InQh+IMiNqNUJvoycg1r6+eNWeoj6RcF2EY/KI+KEk6FMe3NJm1pyck ozoqnsNyYZqkDLYKNe3nAks6bUaLupGNUiBpJFKaF08cmIQMW9J4qBhhh14r54B2BIl0 Sakg== X-Gm-Message-State: AOAM531MXL3b/j99cAYK3RFGonuArIcKuoeCZ+L03p3coR0DIhUPtsE/ s53XIooAVJJnmaCE/bR9M5sVm0mEmbjytXQmbDrOQyTN X-Google-Smtp-Source: ABdhPJxUwSwEP1o+u8RYuzLQQzSAPbWJ9BuX/URp0rbhswXBn6fQR1tG3lm9Kdu5GOrjk+67a9T8kRs3oCRXf1e6RpQ= X-Received: by 2002:a05:6830:410e:: with SMTP id w14mr1929618ott.251.1619791956074; Fri, 30 Apr 2021 07:12:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alan Somers Date: Fri, 30 Apr 2021 08:12:25 -0600 Message-ID: Subject: Re: What is OpenZFS doing during boot? To: =?UTF-8?Q?Ulrich_Sp=C3=B6rlein?= Cc: current X-Rspamd-Queue-Id: 4FWvTK5Hcvz4nR6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 14:12:38 -0000 On Fri, Apr 30, 2021 at 7:21 AM Ulrich Sp=C3=B6rlein wrot= e: > Hi folks, this is a stable/13 question but I figured it's still close > enough to -CURRENT to count. > > So I wanted to update my (remote) system with freebsd-update, but that > installed half a kernel and bricked the machine upon reboot. Lucky me I > fixed OOB access just the day before. > > Did the usual world/kernel build and ran etcupdate, merging in my > local changes. This bricked the system again, as it removed the -x bit on > /etc/rc.d/netif, I filed > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D255514 for that thoug= h > (I > never had such trouble with mergemaster, just even understanding what > etcupdate is trying to do and how to bootstrap it is a mystery to me). > > Anyway, I have a data zpool on 2x encrypted GELI providers that I can onl= y > unlock (and zpool import) with 2 passphrases after the system has booted. > > Color me surprised when some RC script thought otherwise and tried to > import the pool during boot. Why does it do that, that's not supposed to > work and it should not even touch the encrypted bits (yet). > > mountroot: waiting for device /dev/mirror/gm0a... > Dual Console: Serial Primary, Video Secondary > GEOM_ELI: Device gpt/swap0.eli created. > GEOM_ELI: Encryption: AES-XTS 128 > GEOM_ELI: Crypto: accelerated software > GEOM_ELI: Device gpt/swap1.eli created. > GEOM_ELI: Encryption: AES-XTS 128 > GEOM_ELI: Crypto: accelerated software > Setting hostuuid: d7902500-4c7c-0706-0025-90d77c4c0e0f. > Setting hostid: 0x8a2b4277. > cannot import 'data': no such pool or dataset > Destroy and re-create the pool fipmi0: Unknown IOCTL 40086481 > ipmi0: Unknown IOCTL 40086481 > rom > a backup source. > cachefile import failed, retrying > nvpair_value_nvlpid 69 (zpool), jid 0, uid ist(nvp, &rv) =3D=3D 0 (0x16 = =3D=3D 0) > ASSERT at /usr/src/sys/contrib/openzfs/module/nv0: exited on signal 6 > pair/fnvpair.c:586:fnvpair_value_nvlist()Abort trap > cannot import 'data': no such pool or dataset > ipmi0: Unknown IOCTL 40086481 > ipmi0: Unknown IOCTL 40086481 > Destroy and re-cpid 74 (zpool), jid 0, uid 0: exited on signal 6 > reate the pool from > a backup source. > cachefile import failed, retrying > nvpair_value_nvlist(nvp, &rv) =3D=3D 0 (0x16 =3D=3D 0) > ASSERT at > > /usr/src/sys/contrib/openzfs/module/nvpair/fnvpair.c:586:fnvpair_value_nv= list()Abort > trap > Starting file system checks: > /dev/mirror/gm0a: FILE SYSTEM CLEAN; SKIPPING CHECKS > /dev/mirror/gm0a: clean, 370582 free (814 frags, 46221 blocks, 0.2% > fragmentation) > /dev/mirror/gm0d: FILE SYSTEM CLEAN; SKIPPING CHECKS > /dev/mirror/gm0d: clean, 867640 free (1160 frags, 108310 blocks, 0.1% > fragmentation) > /dev/mirror/gm0e: FILE SYSTEM CLEAN; SKIPPING CHECKS > /dev/mirror/gm0e: clean, 1267948 free (17228 frags, 156340 blocks, 0.7% > fragmentation) > Mounting local filesystems:. > > > What do I need to do to _not_ have any zpool operations be attempted duri= ng > startup? How does it even know of the existence of that pool? > > I guess it's zfs_enable=3DNO to stop /etc/rc.d/zpool from messing about. = But > more importantly, the GELI providers don't exist yet, why does it then > segfault? Shouldn't it be a bit more robust on that front? > > Thanks all > Uli > Your problem is the zpool cache file. As soon as ZFS loads, it tries to import all pools mentioned in /boot/zfs/zpool.cache. If you're using ZFS on top of GELI, then obviously you don't want that. What you should is move the cachefile somewhere else. Do it like this: $ zpool set cachefile=3D/some/where/else my-data-pool And on every boot, import it like this: $ service geli start $ zpool import -a -c /some/where/else -o cachefile=3D/some/where/else Hope this helps. -Alan