HomeFreeBSD

Fix issue with finding degraded pool(s).

Description

Fix issue with finding degraded pool(s).

When a pool is degraded, or needs special action, the zpool import
(without pool to import) line will report:

  pool: rpool
    id: 01234567890123456789
 state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:
   [..]

If the import with the pool name fails, it is supposed to try importing
using the pool ID.

However, the script is also getting the action line (and probably scrub:
if/when that's available):

pool; The pool can be imported using its name or numeric identifier.;config:;

which causes issues on consequent import attempts.

Cleanup the information by rewriting the sed command line.

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Closes #18000

Details

Provenance
Turbo Fredriksson <turbo@bayour.com>Authored on Dec 4 2025, 1:57 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Tue, Dec 16, 5:15 PM
Parents
rG33dd57e1b499: Prefix all variables that are local with underscore.
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG94975ff79b3a: Fix issue with finding degraded pool(s). (authored by Turbo Fredriksson <turbo@bayour.com>).Tue, Dec 16, 5:15 PM