summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2015-12-15 02:43:43 +0100
committerNeilBrown <neilb@suse.com>2015-12-16 02:43:56 +0100
commit01290056d01941c9443dddc33768055bd3ed5a73 (patch)
treed06c2c0b5c204b83068f69b618b49904e97b93fd /mdadm.c
parentadd sysfs_array_state to struct mdinfo (diff)
downloadmdadm-01290056d01941c9443dddc33768055bd3ed5a73.tar.xz
mdadm-01290056d01941c9443dddc33768055bd3ed5a73.zip
recreate journal in mdadm
This patch tries recreates missing/faulty journal in mdadm. Example: ./mdadm --fail /dev/md1 /dev/sdb2 mdadm: set /dev/sdb2 faulty in /dev/md1 ./mdadm --stop /dev/md1 mdadm: stopped /dev/md1 ./mdadm -A --scan --force mdadm: Journal is missing or stale, starting array read only. mdadm: /dev/md/1 has been started with 15 drives. ./mdadm --add-journal /dev/md1 /dev/sdb2 mdadm: added /dev/sdb2 Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mdadm.c b/mdadm.c
index f56a8cf8..feec3b70 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -190,6 +190,7 @@ int main(int argc, char *argv[])
case 'a':
case Add:
case AddSpare:
+ case AddJournal:
case 'r':
case Remove:
case Replace:
@@ -925,6 +926,13 @@ int main(int argc, char *argv[])
case O(MANAGE,AddSpare): /* add drive - never re-add */
devmode = 'S';
continue;
+ case O(MANAGE,AddJournal): /* add journal */
+ if (s.journaldisks && (s.level < 4 || s.level > 6)) {
+ pr_err("--add-journal is only supported for RAID level 4/5/6.\n");
+ exit(2);
+ }
+ devmode = 'j';
+ continue;
case O(MANAGE,ReAdd):
devmode = 'A';
continue;