diff options
author | Song Liu <songliubraving@fb.com> | 2015-12-15 02:43:43 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2015-12-16 02:43:56 +0100 |
commit | 01290056d01941c9443dddc33768055bd3ed5a73 (patch) | |
tree | d06c2c0b5c204b83068f69b618b49904e97b93fd /mdadm.c | |
parent | add sysfs_array_state to struct mdinfo (diff) | |
download | mdadm-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.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; |