> What I wanna do is add a spare disk/partition to an existing raid1 array.

Do you want to keep the N-way mirror with N copies, but add a spare so
that when one of the N fails, it will start re-constructing immediately,
or do you want to change it to an N+1 array ?
[ Note that the former will be less resilient, as you can still be caught
  by multiple failures, and that the latter costs more in disk IO when
  writing
]

If the former, just `raidhotadd'.
If the latter, see below ...

> Is there a way to reconfigure the drive(s) without losing data?

For RAID1 it's easy -- it's the other RAIDs that are hard ...


I would:

1) backup the data to tape `just in case' ...
2) shut down the RAID array.
3) create an N+1 way raidtab entry with N-1 of the original disks,
   and two `raid-failed' entries (so that you have a `backup' disk!).
4) FORCE the creation of the new raid array.
   As the N-1 disks were in the original array, they are all already
   holding the same data, so it does not matter which one is chosen as the
   `master' from which the others are copied.
5) `raidhotadd' the new disk you wanted to add in the first place.
6) When re-sync'ed, do whatever checks you want at this point ....
   a) `fsck -n' the individual disks (do **NOT** write !)
   b) `cmp -l' the individual disks `| head' and check that the first
      difference is at the end of the partition (the PSB).
   c) Look at the resultant FS.
7) raidhotadd the backup disk.

Reply via email to