zpool import -d to specify device path

When we know which devices have the pool we are looking for, sometime
it's better if we can directly pass those device paths to zpool import
instead of letting it to search through all unrelated stuff, which might
take a lot of time if you have hundreds of disks.

This patch allows option -d <dev_path> to zpool import. You can have
multiple pairs of -d <dev_path>, and zpool import will only search
through those devices. For example:

    zpool import -d /dev/sda -d /dev/sdb

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
Closes #7077
This commit is contained in:
Chunwei Chen
2018-01-26 10:49:46 -08:00
committed by Brian Behlendorf
parent f55a8757a6
commit 522db29275
6 changed files with 205 additions and 48 deletions
+1
View File
@@ -28,6 +28,7 @@
#define _LIBSPL_LIBGEN_H
#include <sys/types.h>
#include_next <libgen.h>
extern int mkdirp(const char *, mode_t);