Add 'zimport' to aid udev driven pool import (WIP) #1587
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change introduces a new userspace command 'zimport' whose intention
is to be used as a udev helper for dynamically import ZFS pools as
devices appear.
Although this is still a work in progress, the command currently
supports a stateful interface for adding and removing devices:
Once the zimport cache file contains all of the vdevs for a given pool,
it will automatically attempt to import the pool. For example, to import
a pool consisting of two devices (sda1 and sdb1) run the following:
It is also possible to use the '-c' option to specify a custom file name
to use as the cache file. For example, to use the '/var/run/zimport'
instead of the default one can do the following:
Work that still needs to be implemented includes the following:
l2arc devices are not yet supported.
A udev rules helper needs to be added to make use of the 'zimport'
command. This helper should run 'zimport -a %k' to add a device as
they appear and 'zimport -r %k' as they disappear.
The cache file needs to be cleared and/or devices removed from the
cache file as pools are successfully imported.
A configuration interface is needed to specify different policies
which define the conditions which need to be met for a pool to be
imported. For example:
Currently, all vdevs must be present before the pool is imported.
Also, any pool detected will try to be imported.
It would also be useful to be able to specify scripts or executables
to be run at specific points during the device recognition and import
phase.
Signed-off-by: Prakash Surya [email protected]
Issue #330