use disk utility to RAID 1 (Mirror) array
What Is a RAID 1 Mirror?
You don’t need Apple’s Xserve Raid hardware to create your own RAID.
RAID 1, also known as a mirror or mirroring, is one of the many RAID levels supported by OS X and Disk Utility. RAID 1 lets you assign two or more disks as a mirrored set. Once you create the mirrored set, your Mac will see it as a single disk drive. But when your Mac writes data to the mirrored set, it will duplicate the data across all members of the set. This ensures that your data is protected against loss if any hard drive in the RAID 1 set fails. In fact, as long as any single member of the set remains functional, your Mac will continue to operate normally, with complete access to your data. You can remove a defective hard drive from a RAID 1 set and replace it with a new or repaired hard drive. The RAID 1 set will then rebuild itself, copying data from the existing set to the new member. You can continue to use your Mac during the rebuild process, because it takes place in the background.
RAID 1 Is Not a Backup
Although commonly used as part of a backup strategy, RAID 1 by itself is not an effective substitute for backing up your data. Here’s why. Any data written to a RAID 1 set is immediately copied to all members of the set; the same is true when you erase a file. As soon as you erase a file, that file is removed from all members of the RAID 1 set. As a result, RAID 1 does not allow you to recover older versions of data, such as the version of a file you edited last week.
Why Use a RAID 1 Mirror
Using a RAID 1 mirror as part of your backup strategy ensures maximum uptime and reliability. You can use RAID 1 for your startup drive, a data drive, or even your backup drive. In fact, combining a RAID 1 mirrored set and Apple’s Time Machine is an optimum backup method. Let’s get started creating a RAID 1 mirror set.
RAID 1 Mirror: What You Need
You can use Apple’s Disk Utility to create software-based RAID arrays.
In order to create a RAID 1 mirror, you will need a few basic components. One of the items you will need, Disk Utility, is supplied with OS X.
What You Need To Create a RAID 1 Mirror
· OS X 10.5.x or later. The instructions given in this article use OS X Leopard. While these instructions should work for both past and future versions of OS X, some of the steps, nomenclature, or images shown in this article may be different.
· Disk Utility. This is included with OS X.
· Two or more hard drives. Be aware that the process of creating RAID 1 mirrored sets will erase all of the data on the hard drives. It’s best if the hard drives you use are the same make and model, but this is not a requirement.
· One or more drive enclosures. Mac Pro users may have internal drive bays available. Everyone else will need one or more external drive enclosures. If you are using multiple drive enclosures, they should ideally be the same make and model, or at least have the same type of interface, i.e., FireWire, USB, or SATA. This article will not provide instructions for installing and using external enclosures; instead, we will assume you already have them available, or will be building them using one of the guides here at About: Macs.
· A few hours of your time. The process of creating a RAID set is fairly simple and doesn’t take much time. But we will be erasing all of the drives in the RAID set using the Zero Out data option, a somewhat time-consuming process that ensures maximum reliability.
RAID 1 Mirror: Erase Drives
Use Disk Utility to erase the hard drives that will be used in your RAID.
The hard drives you will be using as members of the RAID 1 mirror set must first be erased. And since we are building a RAID 1 set for the purpose of insuring that our data remains accessible, we are going to take a little extra time and use one of Disk Utility’s security options, Zero Out Data, when we erase each hard drive. When you zero out data, you force the hard drive to check for bad data blocks during the erasure process, and to mark any bad blocks as not to be used. This decreases the likelihood of losing data due to a failing block on the hard drive. It also significantly increases the amount of time it takes to erase the drives from a few minutes to an hour or more per drive.
Erase the Drives Using the Zero Out Data Option
1. Make sure the hard drives you intend to use are connected to your Mac and powered up.
2. Launch Disk Utility, located at /Applications/Utilities/.
3. Select one of the hard drives you will be using in your RAID 1 mirror set from the list on the left. Be sure to select the drive, not the volume name that appears indented under the drive’s name.
4. Click the ‘Erase’ tab.
5. From the Volume Format dropdown menu, select ‘Mac OS X Extended (Journaled)’ as the format to use.
6. Enter a name for the volume; I’m using MirrorSlice1 for this example.
7. Click the ‘Security Options’ button.
8. Select the ‘Zero Out Data’ security option, and then click OK.
9. Click the ‘Erase’ button.
10. Repeat steps 3-9 for each additional hard drive that will be part of the RAID 1 mirror set.
Be sure to give each hard drive a unique name.
RAID 1 Mirror: Create the RAID 1 Mirror Set
RAID 1 Mirror Set created, with no hard disks added to the set yet.
Now that we have erased the drives we will use for the RAID 1 mirror set, we’re ready to start building the mirror set.
Create the RAID 1 Mirror Set
1. Launch Disk Utility, located at /Applications/Utilities/, if the application is not already open.
2. Select one of the hard drives you will be using in the RAID 1 mirror set from the Drive/Volume list in the left pane of the Disk Utility window.
3. Click the ‘RAID’ tab.
4. Enter a name for the RAID 1 mirror set. This is the name that will display on the desktop. Since I will be using my RAID 1 mirror set as my Time Machine volume, I’m calling it TM RAID1, but any name will do.
5. Select ‘Mac OS Extended (Journaled)’ from the Volume Format dropdown menu.
6. Select ‘Mirrored RAID Set’ as the Raid Type.
7. Click the ‘Options’ button
8. Set the RAID Block Size. The block size is dependent on the type of data you will be storing on the RAID 1 mirror set. For general use, I suggest 32K as the block size. If you will be storing mostly large files, consider a larger block size such as 256K to optimize the performance of the RAID.
9. Decide if the RAID 1 mirror set you are creating should automatically rebuild itself if the members of the RAID become out of sync. It’s generally a good idea to select the ‘Automatically Rebuild RAID mirror set’ option. One of the few times it may not be a good idea is if you use your RAID 1 mirror set for data intensive applications. Even though it’s performed in the background, rebuilding a RAID mirror set can use significant processor resources and may affect your other use of your Mac.
10. Make your choices on the options and click OK.
11. Click the ‘+’ (plus) button to add the RAID 1 mirror set to the list of RAID arrays.
Add Slices (Hard Drives) to Your RAID 1 Mirror Set
To add members to a RAID set, drag the hard drives to the RAID array.
With the RAID 1 mirror set now available in the list of RAID arrays, it’s time to add members or slices to the set.
Add Slices to Your RAID 1 Mirror Set
1. Drag one of the hard drives from the left-hand pane of Disk Utility onto the RAID array name you created in the last step.Repeat the above step for each hard drive you wish to add to your RAID 1 mirror set. A minimum of two slices, or hard drives, is required for a mirrored RAID.
Once you add all of the hard drives to the RAID 1 mirror set, you are ready to create the finished RAID volume for your Mac to use.
2. Click the ‘Create’ button.
3. A ‘Creating RAID’ warning sheet will drop down, reminding you that all data on the drives that make up the RAID array will be erased. Click ‘Create’ to continue.
During the creation of the RAID 1 mirror set, Disk Utility will rename the individual volumes that make up the RAID set to RAID Slice; it will then create the actual RAID 1 mirror set and mount it as a normal hard drive volume on your Mac’s desktop. The total capacity of the RAID 1 mirror set you create will be equal to the smallest member of the set, minus some overhead for the RAID boot files and data structure.
You can now close Disk Utility and use your RAID 1 mirror set as if it were any other disk volume on your Mac.
Using Your New RAID 1 Mirror Set
RAID 1 MIrror Set created and ready for use.
Now that you have finished creating your RAID 1 mirror set, here are a few tips about its use. OS X treats RAID sets created with Disk Utility as if they were just standard hard drive volumes. As a result, you can use them as startup volumes, data volumes, backup volumes, or just about anything you wish.
You can add additional volumes to a RAID 1 mirror at any time, even long after the RAID array was created. Drives added after a RAID array is created are known as hot spares. The RAID array doesn’t use hot spares unless an active member of the set fails. At that point, the RAID array will automatically use a hot spare as a replacement for the failed hard drive, and will automatically start a rebuild process to convert the hot spare to an active member of the array. When you add a hot spare, the hard drive must be equal to or larger than the smallest member of the RAID 1 mirror set.
Rebuilding can occur any time one or more members of the RAID 1 mirror set become out of sync, that is, the data on a drive doesn’t match other members of the set. When this occurs, the rebuild process will begin, assuming you selected the automatic rebuild option during the RAID 1 mirror set creation process. During the rebuild process, the out-of-sync disk will have data restored to it from the remaining members of the set. The rebuild process can take some time. While you can continue to use your Mac normally during the rebuild, you should not sleep or shut down your Mac during the process. Rebuilding can occur for reasons beyond a hard drive failing. Some common events that can trigger a rebuild are an OS X crash, a power failure, or improperly turning off your Mac.