From 859735c0954e89dd329729c6959df7cbaca1fdcc Mon Sep 17 00:00:00 2001 From: Turbo Fredriksson Date: Fri, 20 Mar 2015 23:29:14 +0100 Subject: Add the '-a' option to 'zpool export' Support exporting all imported pools in one go, using 'zpool export -a'. This is accomplished by moving the export parts from zpool_do_export() in to the new function zpool_export_one(). The for_each_pool() function is used to enumerate the list of pools to be exported. Passing an argc of 0 implies the function should be called on all pools. Signed-off-by: Turbo Fredriksson Signed-off-by: Brian Behlendorf Closes: #3203 --- man/man8/zpool.8 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'man/man8/zpool.8') diff --git a/man/man8/zpool.8 b/man/man8/zpool.8 index 00c19305a..74d7461ce 100644 --- a/man/man8/zpool.8 +++ b/man/man8/zpool.8 @@ -57,7 +57,7 @@ zpool \- configures ZFS storage pools .LP .nf -\fBzpool export\fR [\fB-f\fR] \fIpool\fR ... +\fBzpool export\fR [\fB-a\fR] [\fB-f\fR] \fIpool\fR ... .fi .LP @@ -1059,11 +1059,13 @@ Forces any active datasets contained within the pool to be unmounted. Detaches \fIdevice\fR from a mirror. The operation is refused if there are no other valid replicas of the data. If \fIdevice\fR may be re-added to the pool later on then consider the "\fBzpool offline\fR" command instead. .RE +.RE + .sp .ne 2 .mk .na -\fB\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...\fR +\fB\fBzpool export\fR [\fB-a\fR] [\fB-f\fR] \fIpool\fR ...\fR .ad .sp .6 .RS 4n @@ -1072,6 +1074,17 @@ Exports the given pools from the system. All devices are marked as exported, but Before exporting the pool, all datasets within the pool are unmounted. A pool can not be exported if it has a shared spare that is currently being used. .sp For pools to be portable, you must give the \fBzpool\fR command whole disks, not just partitions, so that \fBZFS\fR can label the disks with portable \fBEFI\fR labels. Otherwise, disk drivers on platforms of different endianness will not recognize the disks. +.sp +.ne 2 +.mk +.na +\fB\fB-a\fR\fR +.ad +.RS 6n +.rt +Exports all pools imported on the system. +.RE + .sp .ne 2 .mk @@ -1079,7 +1092,7 @@ For pools to be portable, you must give the \fBzpool\fR command whole disks, not \fB\fB-f\fR\fR .ad .RS 6n -.rt +.rt Forcefully unmount all datasets, using the "\fBunmount -f\fR" command. .sp This command will forcefully export the pool even if it has a shared spare that is currently being used. This may lead to potential data corruption. -- cgit v1.2.3