diff options
author | Noah Bergbauer <noah.bergbauer@tum.de> | 2020-12-27 21:09:38 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2021-06-14 17:42:03 +0000 |
commit | d575e81fbcfa0a83848a8b9b09dd02497bfd5b00 (patch) | |
tree | 2f849bb6d78c0acfb51091f26f848d66866b191e /lib/geom | |
parent | 715df83abc049b23d9acddc81f2480bd4c056d64 (diff) | |
download | src-d575e81fbcfa0a83848a8b9b09dd02497bfd5b00.tar.gz src-d575e81fbcfa0a83848a8b9b09dd02497bfd5b00.zip |
gconcat: Implement new online append feature
Implement the "gconcat append" command which can be used
to append a disk to the end of an existing gconcat device
without unmounting.
If the gconcat device is using the "automatic" method, i.e.,
stores metadata on the devices, new metadata is written
to all existing components, as well as to the newly added one.
Pull Request: https://github.com/freebsd/freebsd-src/pull/472
Reviewed by: imp@
Diffstat (limited to 'lib/geom')
-rw-r--r-- | lib/geom/concat/gconcat.8 | 45 | ||||
-rw-r--r-- | lib/geom/concat/geom_concat.c | 7 |
2 files changed, 47 insertions, 5 deletions
diff --git a/lib/geom/concat/gconcat.8 b/lib/geom/concat/gconcat.8 index d874b087b649..0aed6dbfb744 100644 --- a/lib/geom/concat/gconcat.8 +++ b/lib/geom/concat/gconcat.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 21, 2004 +.Dd June 14, 2021 .Dt GCONCAT 8 .Os .Sh NAME @@ -46,6 +46,11 @@ .Ar name .Ar prov ... .Nm +.Cm append +.Op Fl hv +.Ar name +.Ar prov +.Nm .Cm stop .Op Fl fv .Ar name ... @@ -104,10 +109,44 @@ method, where metadata are stored in every device's last sector. The kernel module .Pa geom_concat.ko will be loaded if it is not loaded already. +.Pp +Additional options include: +.Bl -tag -width ".Fl h" +.It Fl h +Hardcode providers' names in metadata. +.El +.It Cm append +Append a new device to the end of an existing concatenate device +with the specified +.Ar name . +.Pp +If the existing device is using the +.Dq manual +method, the new device is simply appended as-is. +.Pp +If the existing device is using the +.Dq automatic +method, the device is appended persistently. +New +.Cm gconcat +metadata is written to all existing components, as well as to the +newly added one. +.Pp +Additional options include: +.Bl -tag -width ".Fl h" +.It Fl h +Hardcode providers' names in metadata. +.El .It Cm stop Turn off existing concatenate device by its .Ar name . This command does not touch on-disk metadata! +.Pp +Additional options include: +.Bl -tag -width ".Fl f" +.It Fl f +Stop the given device even if it is opened. +.El .It Cm destroy Same as .Cm stop . @@ -131,10 +170,6 @@ See .Pp Additional options: .Bl -tag -width indent -.It Fl f -Force the removal of the specified concatenated device. -.It Fl h -Hardcode providers' names in metadata. .It Fl v Be more verbose. .El diff --git a/lib/geom/concat/geom_concat.c b/lib/geom/concat/geom_concat.c index 801bea61cdfd..b8144274bf44 100644 --- a/lib/geom/concat/geom_concat.c +++ b/lib/geom/concat/geom_concat.c @@ -53,6 +53,13 @@ static void concat_dump(struct gctl_req *req); static void concat_label(struct gctl_req *req); struct g_command class_commands[] = { + { "append", G_FLAG_VERBOSE, NULL, + { + { 'h', "hardcode", NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + "[-hv] name prov" + }, { "clear", G_FLAG_VERBOSE, concat_main, G_NULL_OPTS, "[-v] prov ..." }, |