Quoting Soeren Schmidt <[EMAIL PROTECTED]>:

 | It seems Soeren Schmidt wrote:
 | >
 | > It should work on 4.7 forward, but its been a while since I played with
 | it.
 | > Another thing is that its a pain to make a mirror on an already running
 | > system (which is often wanted), so I plan to add an option to atacontrol
 | > to tell where to get the master from, and then do an automatic rebuild
 | > during the create phase ie:
 | >
 | > atacontrol create RAID1 ad0 ad2 source ad0
 | >
 | > This will create a mirror using ad0 and ad2, and start a rebuild to
 | > build the master with data from ad0. This way you can do a normal
 | > install, add a second (identical or bigger) disk, and make a
 | > mirror out of those. You just have to change your fstab before
 | > rebooting (ad0 -> ar0) in order to boot...
 | 
 | For those that are brave enough to play with this I just created the
 | following small change to ata-raid.c. Now it will always rebuild the
 | array on creation, using the first disk as the master image. This
 | allows you to turn any set of ATA disks into a mirror on the fly..
 | Remember to rename you filesystems in fstab before booting :)
 | 
 | Index: ata-raid.c
 | ===================================================================
 | RCS file: /home/ncvs/src/sys/dev/ata/ata-raid.c,v
 | retrieving revision 1.50
 | diff -u -r1.50 ata-raid.c
 | --- ata-raid.c  2 Oct 2002 07:44:17 -0000       1.50
 | +++ ata-raid.c  7 Jan 2003 10:02:50 -0000
 | @@ -374,7 +374,14 @@
 |      rdp->flags |= AR_F_READY;
 | 
 |      ar_table[array] = rdp;
 | +
 | +    /* kick off rebuild here */
 | +    if (setup->type == 2) {
 | +           rdp->disks[1].flags &= ~AR_DF_ONLINE;
 | +           rdp->disks[1].flags |= AR_DF_SPARE;
 | +    }
 |      ar_attach_raid(rdp, 1);
 | +    ata_raid_rebuild(array);
 |      setup->unit = array;
 |      return 0;
 |  }

Søren,

This is a real temptation.  Let me be sure that I'm understanding 
correctly.  I have an old machine, but running today's current, with only 
one disk, ad0. Could I do the following?

  o- Add ad2
  o- run atacontrol create RAID1 ad0 ad2 source ad0
  o- change ad0s1a to ar0s1a through ad0s1f to ar0s1f in fstab
  o- reboot and enjoy my new mirror.

If ar0 were to die, I would just take it out connect ar2 and boot as ?
I could then do the same with a new mirror, I suppose?

If I'm understanding correctly, I could use any disk > ad0 as the mirror.
Is that correct?  

One last question, what prompted you to preceed the patch with 
"For those that are brave enough to play with this", where could
it come back and bit me? :-)

Thanks,

ed


-------------------------------------------------


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to