Discussion:
Expelling a pool from zpool.cache without exporting it
Jim Klimov via illumos-zfs
2014-07-02 11:59:11 UTC
Permalink
Hello all,

I was converting a pool last month to be imported as an SMF service
(and a pre-requisite for the SMFized zones to start up) per my own
write-ups [1][2], and one of the "problems" that struck me was that
it was rather inconvenient on this machine to export the pool just
in order to remove it from zpool.cache and properly set up the SMF
service (i.e. no auto-import by the OS, only "uncached" import via
SMF explicitly) because it was busy with some long-running task
(in a zone on this pool).

So I wondered if it is possible to "expel" a pool from the system's
zpool.cache without exporting it and unmounting all its datasets?
The rationale is that I might get distracted and forget to do this
later; the host might crash or otherwise reboot at an inconvenient
time (they always do, following Murphy's laws), and then the OS
import would fire long before the SMFized pool import. This might
also be a problem (due to a number of causes that are outside this
question's scope).

[1]
http://wiki.openindiana.org/oi/Advanced+-+ZFS+Pools+as+SMF+services+and+iSCSI+loopback+mounts

[2] http://wiki.openindiana.org/display/oi/Zones+as+SMF+services

Thanks for ideas,
Jim
Richard Elling via illumos-zfs
2014-07-02 14:41:49 UTC
Permalink
see cachefile option

-- richard
Post by Jim Klimov via illumos-zfs
Hello all,
I was converting a pool last month to be imported as an SMF service
(and a pre-requisite for the SMFized zones to start up) per my own
write-ups [1][2], and one of the "problems" that struck me was that
it was rather inconvenient on this machine to export the pool just
in order to remove it from zpool.cache and properly set up the SMF
service (i.e. no auto-import by the OS, only "uncached" import via
SMF explicitly) because it was busy with some long-running task
(in a zone on this pool).
So I wondered if it is possible to "expel" a pool from the system's
zpool.cache without exporting it and unmounting all its datasets?
The rationale is that I might get distracted and forget to do this
later; the host might crash or otherwise reboot at an inconvenient
time (they always do, following Murphy's laws), and then the OS
import would fire long before the SMFized pool import. This might
also be a problem (due to a number of causes that are outside this
question's scope).
[1] http://wiki.openindiana.org/oi/Advanced+-+ZFS+Pools+as+SMF+services+and+iSCSI+loopback+mounts
[2] http://wiki.openindiana.org/display/oi/Zones+as+SMF+services
Thanks for ideas,
Jim
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182191/22820713-4fad4b89
Modify Your Subscription: https://www.listbox.com/member/?&
Powered by Listbox: http://www.listbox.com
Matthew Ahrens via illumos-zfs
2014-07-02 16:32:55 UTC
Permalink
Yep. "zpool set cachefile=none" or cachefile=<some other file> should
remove it from the default cachefile.

--matt


On Wed, Jul 2, 2014 at 7:41 AM, Richard Elling via illumos-zfs <
Post by Richard Elling via illumos-zfs
see cachefile option
-- richard
On Jul 2, 2014, at 4:59 AM, "Jim Klimov via illumos-zfs" <
Hello all,
I was converting a pool last month to be imported as an SMF service
(and a pre-requisite for the SMFized zones to start up) per my own
write-ups [1][2], and one of the "problems" that struck me was that
it was rather inconvenient on this machine to export the pool just
in order to remove it from zpool.cache and properly set up the SMF
service (i.e. no auto-import by the OS, only "uncached" import via
SMF explicitly) because it was busy with some long-running task
(in a zone on this pool).
So I wondered if it is possible to "expel" a pool from the system's
zpool.cache without exporting it and unmounting all its datasets?
The rationale is that I might get distracted and forget to do this
later; the host might crash or otherwise reboot at an inconvenient
time (they always do, following Murphy's laws), and then the OS
import would fire long before the SMFized pool import. This might
also be a problem (due to a number of causes that are outside this
question's scope).
[1]
http://wiki.openindiana.org/oi/Advanced+-+ZFS+Pools+as+SMF+services+and+iSCSI+loopback+mounts
[2] http://wiki.openindiana.org/display/oi/Zones+as+SMF+services
Thanks for ideas,
Jim
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
https://www.listbox.com/member/archive/rss/182191/22820713-4fad4b89
Modify Your Subscription: https://www.listbox.com/member/?&
Powered by Listbox: http://www.listbox.com
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
https://www.listbox.com/member/archive/rss/182191/21635000-ebd1d460
https://www.listbox.com/member/?&
Powered by Listbox: http://www.listbox.com
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182191/23047029-187a0c8d
Modify Your Subscription: https://www.listbox.com/member/?member_id=23047029&id_secret=23047029-2e85923f
Powered by Listbox: http://www.listbox.com
Jim Klimov via illumos-zfs
2014-07-03 20:57:17 UTC
Permalink
Post by Matthew Ahrens via illumos-zfs
Yep. "zpool set cachefile=none" or cachefile=<some other file> should
remove it from the default cachefile.
--matt
On Wed, Jul 2, 2014 at 7:41 AM, Richard Elling via illumos-zfs
see cachefile option
-- richard
Thanks, and to confirm just in case before I botch something -
this should also work "live" on a currently imported pool, right?

Thanks again,
Jim
Matthew Ahrens via illumos-zfs
2014-07-03 21:29:16 UTC
Permalink
Post by Jim Klimov via illumos-zfs
Post by Matthew Ahrens via illumos-zfs
Yep. "zpool set cachefile=none" or cachefile=<some other file> should
remove it from the default cachefile.
--matt
On Wed, Jul 2, 2014 at 7:41 AM, Richard Elling via illumos-zfs
see cachefile option
-- richard
Thanks, and to confirm just in case before I botch something -
this should also work "live" on a currently imported pool, right?
yes.

--matt
Post by Jim Klimov via illumos-zfs
Thanks again,
Jim
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182191/23047029-187a0c8d
Modify Your Subscription: https://www.listbox.com/member/?member_id=23047029&id_secret=23047029-2e85923f
Powered by Listbox: http://www.listbox.com

Loading...