core icon indicating copy to clipboard operation
core copied to clipboard

use zpool.cache when importing pools at boot

Open nt1 opened this issue 1 year ago • 2 comments

Fixes issue https://github.com/opnsense/core/issues/7553

nt1 avatar Jun 26 '24 10:06 nt1

Thanks. Ideally hardcoding cache files should be avoided. It just looks like a maintenance spot further down the road. As said I’ll take a look when I’m back.

fichtner avatar Jun 26 '24 12:06 fichtner

Minimally, I'll move those string constants to a better place for the sake of maintainability. This would also be a good place for a link to openzfs zpool cache documentation.

nt1 avatar Jun 26 '24 18:06 nt1

To be frank I'd prefer something like

ZPOOL_IMPORT_PATH="/dir1:/dir2"
export ZPOOL_IMPORT_PATH

The docs say:

ZPOOL_IMPORT_PATH The search path for devices or files to use with the pool. This is a colon-separated list of directories in which zpool looks for device nodes and files. Similar to the -d option in zpool import.

But the fun part is nothing really says what the compatible directory default is nor does the code make an effort to bootstrap a default.

Cheers, Franco

fichtner avatar Aug 01 '24 10:08 fichtner

Ok from the old code "/dev" should suffice so if you can let me know if this works as well... e7d80522e3

fichtner avatar Aug 01 '24 10:08 fichtner

Shipping 701dff45b2f can't hurt so I will.

fichtner avatar Aug 13 '24 13:08 fichtner