Replacing a RAID set under El Capitan

Over Thanksgiving, one of the two drives in my "Big Disk" RAID (it was a mirror of 2 2TB drives that I used to store large things that aren't worth having on the SSD on my Mac Pro).   Generally speaking, my response to failures with SMART (especially with cheap spinning rust drives) is to replace the drive immediately and if it's a set of drives in a RAID to consider replacing both of them and bumping to the next most efficient capacity.  
For this year's upgrade (it's actually been 2+ years since the time these drives were installed), the most cost efficient drives are 4TB.  I don't think I'm likely to fill them up any time soon, but pictures and video aren't getting smaller, and I sometimes have to store some large GIS database on these while I'm working with them, and the new drives are NAS rated and have a 3 year warranty, so I need to anticipate use for 3 years out.
With El Capitan, Apple's Disk Utility program has become... well, pretty lackluster.  However, from a RAID perspective, I've used the command line for years because of the desire to have explicit control over what's being done.
The key objectives:

  • Replace the 2TB mirrored RAID with a 4TB mirrored RAID
  • Retain the existing Time Machine history
  • Retain the existing CrashPlan history

The process was quick and successful, and here are the steps that I took:

  1. Using an external SATA to Thunderbolt dock, I attached and formatted the new 4TB drive, naming it something other than it's final name.  Because of the way OS X handles name collisions, I didn't want any confusion in the devices, so I chose to only have one drive mounted with a particular name at a particular time.  
  2. Using Carbon Copy Cloner, I cloned the old 2TB RAID's contents onto the new 4TB drive.  Averaging >100MB/s, this still took a while (about 4 hours for the 1.4TB of active storage)
  3. Once the clone was complete, I unmounted the 2TB RAID and pulled both of the constituent drives from the LaCie 5Big Thunderbolt (link is to the TB2 version of this device) and set them aside.
  4. Before setting the old drives down, I marked them with a Sharpie, taking care to mark the FAILED drive so that it could be destroyed, and the OK drive so that it could be retained if desired as a snapshot.  I'll keep it for at least a few weeks, but then it'll either go to the safe deposit box, or the disk shredder.  Drives are always marked with the RAID name and date they were taken out of service, along with any appropriate legends (Personal and Confidential, copyright, etc)
  5. Unmount the 4TB drive from the external SATA to Thunderbolt dock and install it, and it's future mirror into the enclosure
  6. Once the 4TB drive remounts from the enclosure, make sure that Time Machine isn't running (and either wait for it to stop, or cancel the run before proceeding) 
  7. Now, convert the 4TB drive to the new RAID by using Terminal and the command line:
    diskutil appleRAID enable mirror /dev/disk3s2
    You will need to replace /dev/disk3s2 with the slice number corresponding to the volume on the disk, not the disk device itself.  This can be gathered by using diskutil's list command if you are uncertain.
  8. Rename the 4TB drive to the name of the original RAID (this takes care of the CrashPlan issue, since CrashPlan only knows the path to volumes)
  9. Now that we have the RAID set prepared and the volume renamed, we need to make sure that Time Machine thinks it's the same drive for content purposes.  To do this we'll use Terminal again:
    sudo tmutil associatedisk -a "/Volumes/RAID" /Volumes/TM/Backups.backupdb/Machine/Latest/RAID
    Names have been changed for privacy, but the basics are clear, you need to replace /Volumes/RAID with the UNIX path of your volume as mounted on your computer and the second path is the path to the volume name in the Latest Time Machine backup.  Do not associate with another backup or you'll get an error.
  10. To confirm this process, you can start a TM backup and see if you see a message from backupd in the Console app like this:
    com.apple.backupd[1931]: Inheritance scan may be required for '/Volumes/RAID', associated with previous UUID: XXXXX-XXXX-XXXX-XXXX-XXXXXXX
    Indicating that Time Machine will try and sync up the volume histories.
  11. Once the initial Time Machine backup is complete, start rebuilding the RAID (this is going to take a long time, which is why I do it after the initial TM backup), using Terminal again:
    diskutil appleRAID add member /dev/disk4 disk7
    replacing /dev/disk4 with the device you want to add, and disk7 with the RAID's Device Node (you can again find these using diskutil's list command)

A bit time consuming, but everything worked like a charm, and I have full access to my Time Machine history for my new RAID set.