From nobody Thu Aug 14 20:45:05 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4c2y112cTfz641CR for ; Thu, 14 Aug 2025 20:45:09 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp-relay-int-backup.realworks.nl (smtp-relay-int-backup.realworks.nl [87.255.56.188]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4c2y105m5dz4213 for ; Thu, 14 Aug 2025 20:45:08 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Authentication-Results: mx1.freebsd.org; none Received: from smtp-relay-int-backup.realworks.nl (crmpreview7.colo2.realworks.nl [10.2.52.37]) by mailrelayint2.colo2.realworks.nl (Postfix) with ESMTP id 4c2y0y4gwQz183; Thu, 14 Aug 2025 22:45:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1755204306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=UARfAFHIeHd9jRxJKjVL3AysbMQpU84j7nI+d8xtVe0=; b=jr14ButyiFZzCasRbS4oBbsIYA6axcytsbvoSEdiu1BDkySfcZC50aaVe2yTvpEMkQ8Q/R IG0M2R0ZZNh/xOkS1c9up50Awf4hSqALGMSRQkrinFMP2TjLBSRo8YRlk7AxilFOnc1rg6 +i1qUanLsEi9jcpgxSfF9JubPN2DcDoxpKOHe7h8tg8e3QVw1E0BKF+jcA3JLBXwQbl63D M3/O7ObDMnS5GcAx10H2XHDyaNlo75SOOdc3h/Fwy9XGkGLA0Pqb1RY7nUyx3ZINeNZziX U7N0OPIE+jCs60MjLdX6vpmdiq3UEiWadmCXhIrP4MfMecb/VM0gVOOUjch26g== Received: from crmpreview7.colo2.realworks.nl (localhost [127.0.0.1]) by crmpreview7.colo2.realworks.nl (Postfix) with ESMTP id 5BE1D18015D; Thu, 14 Aug 2025 22:45:05 +0200 (CEST) Date: Thu, 14 Aug 2025 22:45:05 +0200 (CEST) From: Ronald Klop To: Dennis Clarke Cc: freebsd-current@freebsd.org Message-ID: <1333504824.10718.1755204305959@localhost> In-Reply-To: <04fafcf2-3b22-44b3-a600-87f51054a803@blastwave.org> Subject: Re: How does one add a zpool name to either /etc/zfs/zpool.cache or /boot/zfs/zpool.cache ? List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10717_578605634.1755204305956" X-Mailer: Realworks (761.71) X-Originating-Host: from (localhost [127.0.0.1]) by crmpreview7.colo2.realworks.nl [10.2.52.37] with HTTP; Thu, 14 Aug 2025 22:45:05 +0200 Importance: Normal X-Priority: 3 (Normal) X-Rspamd-Queue-Id: 4c2y105m5dz4213 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:38930, ipnet:87.255.32.0/19, country:NL] ------=_Part_10717_578605634.1755204305956 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Van: Dennis Clarke Datum: 14 augustus 2025 20:55 Aan: freebsd-current@freebsd.org Onderwerp: How does one add a zpool name to either /etc/zfs/zpool.cache or /boot/zfs/zpool.cache ? > > > > After a reboot I have a zpool missing. I have to import it manually. > > The script /etc/rc.d/zpool seems to be the culprit in that it > processes two zpool cache files : > > t# > t# cat /etc/rc.d/zpool > #!/bin/sh > # > # > > # PROVIDE: zpool > # REQUIRE: hostid disks > # BEFORE: mountcritlocal > # KEYWORD: nojail > > . /etc/rc.subr > > name="zpool" > desc="Import ZPOOLs" > rcvar="zfs_enable" > start_cmd="zpool_start" > required_modules="zfs" > > zpool_start() > { > local cachefile > > for cachefile in /etc/zfs/zpool.cache /boot/zfs/zpool.cache; do > if [ -r $cachefile ]; then > zpool import -c $cachefile -a -N > if [ $? -ne 0 ]; then > echo "Import of zpool cache ${cachefile} failed," > "will retry after root mount hold release" > root_hold_wait > zpool import -c $cachefile -a -N > fi > break > fi > done > } > > load_rc_config $name > run_rc_command "$1" > t# > > However neither of those cache files seem to hold information about > anything other than the pool created during installation. > > There is a cachefile property in a zpool but that vanishes after a > reboot. > > So then .. whats the magic here? > > > -- > -- > Dennis Clarke > RISC-V/SPARC/PPC/ARM/CISC > UNIX and Linux spoken > > > > > > Hi, You have a similar question here. https://lists.freebsd.org/archives/freebsd-current/2024-November/006736.html Is this about the same machine/setup? Do the replies in that thread answer your current question about the cachefile property? Regards, Ronald ------=_Part_10717_578605634.1755204305956 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit

Van: Dennis Clarke <dclarke@blastwave.org>
Datum: 14 augustus 2025 20:55
Aan: freebsd-current@freebsd.org
Onderwerp: How does one add a zpool name to either /etc/zfs/zpool.cache or /boot/zfs/zpool.cache ?


After a reboot I have a zpool missing. I have to import it manually.

The script /etc/rc.d/zpool seems to be the culprit in that it
processes two zpool cache files :

t#
t# cat /etc/rc.d/zpool
#!/bin/sh
#
#

# PROVIDE: zpool
# REQUIRE: hostid disks
# BEFORE: mountcritlocal
# KEYWORD: nojail

. /etc/rc.subr

name="zpool"
desc="Import ZPOOLs"
rcvar="zfs_enable"
start_cmd="zpool_start"
required_modules="zfs"

zpool_start()
{
         local cachefile

         for cachefile in /etc/zfs/zpool.cache /boot/zfs/zpool.cache; do
                 if [ -r $cachefile ]; then
                         zpool import -c $cachefile -a -N
                         if [ $? -ne 0 ]; then
                                 echo "Import of zpool cache ${cachefile} failed,"
                                     "will retry after root mount hold release"
                                 root_hold_wait
                                 zpool import -c $cachefile -a -N
                         fi
                         break
                 fi
         done
}

load_rc_config $name
run_rc_command "$1"
t#

However neither of those cache files seem to hold information about
anything other than the pool created during installation.

There is a cachefile property in a zpool but that vanishes after a
reboot.

So then .. whats the magic here?


-- 
--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken





Hi,

You have a similar question here.


Is this about the same machine/setup?

Do the replies in that thread answer your current question about the cachefile property?

Regards,
Ronald

------=_Part_10717_578605634.1755204305956--