Date: Thu, 14 Aug 2025 22:45:05 +0200 (CEST) From: Ronald Klop <ronald-lists@klop.ws> To: Dennis Clarke <dclarke@blastwave.org> Cc: freebsd-current@freebsd.org Subject: Re: How does one add a zpool name to either /etc/zfs/zpool.cache or /boot/zfs/zpool.cache ? Message-ID: <1333504824.10718.1755204305959@localhost> In-Reply-To: <04fafcf2-3b22-44b3-a600-87f51054a803@blastwave.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
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.
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
[-- Attachment #2 --]
<html><head></head><body><br><br class="rw_extra"><p><small><strong>Van:</strong> Dennis Clarke <dclarke@blastwave.org><br><strong>Datum:</strong> 14 augustus 2025 20:55<br><strong>Aan:</strong> freebsd-current@freebsd.org<br><strong>Onderwerp:</strong> How does one add a zpool name to either /etc/zfs/zpool.cache or /boot/zfs/zpool.cache ?<br></small></p><blockquote style="margin-left: 5px; border-left: 3px solid #ccc; margin-right: 0px; padding-left: 5px;"><div class="MessageRFC822Viewer" id="P"><!-- P -->
<!-- processMimeMessage --><div class="TextPlainViewer" id="P.P"><!-- P.P --><br>
After a reboot I have a zpool missing. I have to import it manually.<br>
<br>
The script /etc/rc.d/zpool seems to be the culprit in that it<br>
processes two zpool cache files :<br>
<br>
t#<br>
t# cat /etc/rc.d/zpool<br>
#!/bin/sh<br>
#<br>
#<br>
<br>
# PROVIDE: zpool<br>
# REQUIRE: hostid disks<br>
# BEFORE: mountcritlocal<br>
# KEYWORD: nojail<br>
<br>
. /etc/rc.subr<br>
<br>
name="zpool"<br>
desc="Import ZPOOLs"<br>
rcvar="zfs_enable"<br>
start_cmd="zpool_start"<br>
required_modules="zfs"<br>
<br>
zpool_start()<br>
{<br>
local cachefile<br>
<br>
for cachefile in /etc/zfs/zpool.cache /boot/zfs/zpool.cache; do<br>
if [ -r $cachefile ]; then<br>
zpool import -c $cachefile -a -N<br>
if [ $? -ne 0 ]; then<br>
echo "Import of zpool cache ${cachefile} failed," <br>
"will retry after root mount hold release"<br>
root_hold_wait<br>
zpool import -c $cachefile -a -N<br>
fi<br>
break<br>
fi<br>
done<br>
}<br>
<br>
load_rc_config $name<br>
run_rc_command "$1"<br>
t#<br>
<br>
However neither of those cache files seem to hold information about<br>
anything other than the pool created during installation.<br>
<br>
There is a cachefile property in a zpool but that vanishes after a<br>
reboot.<br>
<br>
So then .. whats the magic here?<br>
<br>
<br>
-- <br>
--<br>
Dennis Clarke<br>
RISC-V/SPARC/PPC/ARM/CISC<br>
UNIX and Linux spoken<br>
<br>
<br>
</div><!-- TextPlainViewer -->
<hr>
</div><!-- MessageRFC822Viewer -->
</blockquote><br><br>Hi,<div><br></div><div>You have a similar question here.</div><div><br></div><div><a href="https://lists.freebsd.org/archives/freebsd-current/2024-November/006736.html">https://lists.freebsd.org/archives/freebsd-current/2024-November/006736.html</a></div><div><br></div><div>Is this about the same machine/setup?</div><div><br></div><div>Do the replies in that thread answer your current question about the cachefile property?</div><div><br></div><div>Regards,</div><div>Ronald</div><br></body></html>
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1333504824.10718.1755204305959>
