summaryrefslogtreecommitdiff
path: root/mdadm.8.in
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-05-16 15:07:16 +1000
committerNeilBrown <neilb@suse.de>2013-05-16 15:07:16 +1000
commit74db60b00a43a5ae636477c10c24e923e76049ce (patch)
tree168664568b7c8d27b12ef00ad0119ac29b2c1056 /mdadm.8.in
parentb31df43682216d1c65813eae49ebdd8253db8907 (diff)
Add --dump / --restore functionality.
This allows the metadata on a device to be saved and later restored. This can be useful before experimenting on an array that is misbehaving. Suggested-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.8.in')
-rw-r--r--mdadm.8.in49
1 files changed, 49 insertions, 0 deletions
diff --git a/mdadm.8.in b/mdadm.8.in
index c8766595..c8559dae 100644
--- a/mdadm.8.in
+++ b/mdadm.8.in
@@ -1449,6 +1449,12 @@ been configured. Currently only
metadata supports bad-blocks lists.
.TP
+.BI \-\-dump= directory
+.TP
+.BI \-\-restore= directory
+Save metadata from lists devices, or restore metadata to listed devices.
+
+.TP
.BR \-R ", " \-\-run
start a partially assembled array. If
.B \-\-assemble
@@ -2136,6 +2142,49 @@ without listing any devices will cause all devices listed in the
config file to be examined.
.TP
+.BI \-\-dump= directory
+If the device contains RAID metadata, a file will be created in the
+.I directory
+and the metadata will be written to it. The file will be the same
+size as the device and have the metadata written in the file at the
+same locate that it exists in the device. However the file will be "sparse" so
+that only those blocks containing metadata will be allocated. The
+total space used will be small.
+
+The file name used in the
+.I directory
+will be the base name of the device. Further if any links appear in
+.I /dev/disk/by-id
+which point to the device, then hard links to the file will be created
+in
+.I directory
+based on these
+.I by-id
+names.
+
+Multiple devices can be listed and their metadata will all be stored
+in the one directory.
+
+.TP
+.BI \-\-restore= directory
+This is the reverse of
+.BR \-\-dump .
+.I mdadm
+will locate a file in the directory that has a name appropriate for
+the given device and will restore metadata from it. Names that match
+.I /dev/disk/by-id
+names are preferred, however if two of those refer to different files,
+.I mdadm
+will not choose between them but will abort the operation.
+
+If a file name is given instead of a
+.I directory
+then
+.I mdadm
+will restore from that file to a single device, always provided the
+size of the file matches that of the device, and the file contains
+valid metadata.
+.TP
.B \-\-stop
The devices should be active md arrays which will be deactivated, as
long as they are not currently in use.