diskutil listIn most cases you’re going to be booted to the volume you’re going to turn into a RAID and it’s likely to be disk0. Therefore, assuming that the volume is disk0 use the diskutil command with the enableRAID verb (which does basically what the name implies) and then list the type of RAID (in this case we’re going to use mirror as a stripe would require a complete rebuild) and then list the device (in our case again, this is disk0). So the complete second command, which will enable the RAID is as follows:
diskutil enableRAID mirror disk0At this point you have a drive that wants to be a mirror but isn’t (without a second member). So to add the second drive (the beauty to our geek) go ahead and use the diskutil command with the repairMirror verb. Here, you will “repair” the mirror using the source (so-to-speak) followed by the destination (again, so-to-speak). Here we’re going to assume disk0 from earlier followed by disk1:
diskutil repairMirror disk0 disk1Now wait. And wait and wait and wait. Then it will be done and you’ll be able to move on to other tasks. For example, if you have an Xserve you can move your journal to that SSD drive or resize a partition and use the free space for something else, effectively disassociating operating system from actual data sets. Overall, this is a huge time saver in some setup scenarios and can help to be able to spend more time on other important things, like workflow. Finally, this can easily be scripted; however, when you do so keep in mind that the changes that you make programatically make a lot of assumptions and if you have servers that aren’t identical (or have existing data sets somewhere), that it can be more dangerous than simply typing the three commands in sequence (otherwise I’d of written a GUI app to do it a long time ago). Note: I wasn’t sure where I initially learned how to do this since it was 5 years ago. My apologies for not initially looking up the reference and my hat off to Josh for teaching me how to do something that has saved me countless hours over the past few years: http://www.afp548.com/article.php?story=20040827122302975 While I’m at it, thanks to everyone else. Sorry if I forget to acknowledge anyone in books, articles, etc. It is never intentional, I assure you.
krypted November 24th, 2009