Soft raid. How to create a RAID array and why is it needed

Hard drives are the main storage of information on the computer. But they, unfortunately, are not eternal. And it’s very annoying to once realize that the “accumulated overwork” suddenly disappears due to the failure of the disk. In some cases, data can be recovered. But usually only partially. And that is not always the case.

How to protect yourself from data loss on hard drives? There are several solutions to this problem.

The easiest is to periodically drop important data onto external media: DVD / Blu-ray discs, flash drives, external hard   wheels. The option is actually quite reliable, but not quite convenient: you need to remember and find time for reserve copy   data, in addition, data from the last copy to disk crash will still be lost.

In order not to mess with external media, you can install another HDD in the computer and periodically copy data to it. Better yet, if this were done automatically.

Such automation has been used for a long time and it has found its expression in the so-called RAID-arrays. These are arrays of hard drives combined in a special way. There are several types of RAID-s, the most popular of them are "RAID-0" - 2 disks are included sequentially for faster read-write data, and "RAID-1" - 2 disks are connected in parallel to simultaneously write data to both HDDs at once. If one of the disks fails, the other disk with a mirror copy of the data remains, and the probability of failure of the two disks at the same time is very small. RAID-1 is usually called a "mirror", and the parallel inclusion of several drives - "mirroring".

To implement a disk array, a RAID controller must be installed in the computer. It can be integrated into the motherboard, or can be installed separately.

My personal experience   working with RAID controllers built into the motherboard is rather disastrous. Typically, manufacturers, to reduce the price of the product, use inexpensive controllers, the reliability of which leaves much to be desired. Individual good-quality controllers cost at least a hundred dollars.

In this regard, in lately   so-called "software RAIDs", i.e. parallel writing of data to 2 disks is performed not at the hardware level, but at the software level. Special program monitors all operations of writing data to a specific disk and writes the same data to another disk.

In the operating systems Windows 7 and Windows 8, developers integrated software RAID into the OS itself, i.e. You can mirror data windows tools.

I want to make a reservation right away that this functionality is not suitable for those who like to install several operating systems on one computer. Ultimately, only that OS will remain operational, by which it was mirrored. And if you perform the steps incorrectly, then no working OS will remain. Further in the article I will pay attention to these points and tell you how to avoid such errors.

If your computer has only one operating system, you can safely use everything described below, nothing threatens your Windows.

So, in order to see all the pitfalls of data mirroring using OS tools, I use a computer with 2 installed operating systems - Windows 7 and Windows 8. The first one was installed on Windows 7, and then on the other logical drive, Windows 8. We will perform the mirroring itself in Windows 8.

What is needed for this? The computer must have 2 physical hard drives. It cannot be otherwise - copying the disk data onto it itself is devoid of any meaning, since when the disk leaves the styro we will lose both the data and its copy at the same time. The advantage of software RAID is that, unlike hardware RAID, it can be configured for individual logical drives, and not just for the entire physical drive as a whole.

To create a mirror, you must enter Disk Management. To do this, go to the Control Panel and select "Administration".

In Administration we find "Computer Management".

In the Computer Management window on the left, select "Disk Management".

It can be seen from the figure that there are 2 physical disks on the computer - "Disk 0" and "Disk 1". We will create a mirror for the logical drive F ( New volume) located on Disk 0. The volume of this section is 10GB. We have second HDD   (Disk 1), with a capacity of 12 GB, which we use as a mirror. The second disk must be unallocated free place, the volume of which is not less than the volume of the mirrored disk. We have 12GB on Disk 1 unallocated space, i.e. There are no logical drives in this space.

Right-click on the desired section and select "Add Mirror" in the context menu.

The system will prompt you to select a drive that will be used as a mirror.

Choose desired drive   from the list and click "Add mirrored volume". Here comes an interesting warning:

We are warned that the disks will be converted to dynamic ones, and if several operating systems are installed on the computer, then after this operation is completed, only the OS that is currently running will remain operational. We will verify this later. Click "Yes."

The process of creating a mirror will begin - if there is any data on drive F, it will be copied to the mirror drive.

After completing all the processes, we get such a picture.

As you can see, the system took space from the second disk, the volume of which is equal to the volume of the mirrored disk. The remaining space of the second disk remains unallocated and you can use it at your own discretion, for example, create another logical disk there.

Check if we can now download the second OS installed on the computer. Let me remind you, in my case, Windows 7 and Windows 8 were installed, all the actions we performed under Windows 8. Let's try to download Windows 7.

We reboot the computer, we get a list of OS choices.

We select Windows 7, the boot process begins and ... we get this.

Now about pitfalls, which I mentioned at the beginning of the article. It was not in vain that I made a reservation that Windows 8 was installed after Windows 7. What does this affect? The fact is that there can only be one OS loader on a computer. And the bootloader is always the last bootloader installed operating system   - it overwrites the previous bootloader found on the disk. But at the same time, during the installation process, Windows, having found the previously installed operating systems on the computer, configures its bootloader so that it provides the user with a list of installed OS at startup. From this list we choose which OS we want to run now. In my case, it starts windows bootloader   8, which was last installed, and offers a list of found operating systems. Now imagine that I would configure mirroring not in Windows 8, but in Windows 7. In this case, Windows 8 would become inoperative. And with her, her loader would cease to function, and I would lose the opportunity to run any OS on my computer altogether - verified by experience. The solution to this problem can only be reinstalling Windows.

Thus, if several operating systems are installed on your computer, you can configure mirroring only in the last installed OS, while all other OSs will automatically become inoperative and it will be impossible to bring them back to life   - then we will see it .

Setting up a software RAID array in a Windows environment is a much simpler task than under Linux systems, but it also has its own characteristics. Often incomplete and fragmentary knowledge in this area leads to difficulties, and myths and legends about the "capriciousness" and "glitchiness" of this mechanism in Windows are among the administrators. In this article, we will try to fill this gap.

Before continuing, we again recall the basic principle of building hardware arrays: one array element - one physical disk. The basis of software arrays is a logical drive. Understanding this difference is the key to success, something that applies to the hardware array can be disastrous for the software, especially when it comes to the failure of one of the elements of the array.

To create software RAID in a Windows environment, we need to get acquainted with the concept of a dynamic disk, since software arrays can only be created on them. Reputation dynamic drives   ambiguous, many administrators shy away from them, like hell from incense. But in vain, remembering a few simple rules, working with dynamic disks becomes as simple as with regular ones.

Main rule: installation or windows boot   from dynamic volume   only possible if this disk has been converted from a system or boot volume. Those. if you have several instances of the OS, then after converting the disk to dynamic, you can only load the instance that is on the boot partition.

Based on this rule, it becomes obvious that only mirrored arrays (RAID1) can be created for boot and system volumes, other types of arrays cannot be created, since they imply installing the system on a previously created partition.

Is the game worth the candle? Despite all the limitations, it's worth it. The main drawback of hardware arrays is binding to specific model   the controller. If your motherboard or controller burns out, you will need exactly the same (or a motherboard with a similar controller), otherwise you can say goodbye to the data. In the case of software RAID, a machine with enough installed windows   Server

In practice, working with software arrays and dynamic disks is done through a snap Storage - Disk Management   in Server Manager. To convert disks into dynamic ones, just right-click on one of them and select Convert to dynamic disk, in the window that opens, you can select several disks for conversion at once.

It is worth remembering that this operation is irreversible and special attention should be paid to the system partition, redistribute boot disk   you won’t succeed (more precisely, it will cease to be bootable after that), the only thing you can do is expand the volume due to unallocated space.

The next step will be to create an array, right-click on the desired volume and select the desired option, in the case of system and boot volumes, there will be one option - a mirror, then you will be asked to select a disk to host the mirrored volume. Upon completion of the array creation, resynchronization will immediately begin.

By connecting additional drives   we will get much more opportunities, you can either combine several disks into a separate volume, or create RAID 0, 1 or 5.

In general, nothing complicated, but many restrictions can scare anyone. But do not rush to make hasty conclusions, there are no serious obstacles to common thinking, since it is usually customary to distribute the system and data to different disks, given the penny cost of modern disks, this does not entail significant costs. For example, we created a mirror for our test server system disk   and RAID5 for data.

And all this pleasure can be realized on the most ordinary budget motherboardConsidering that the performance of a software array is no different from cheap hardware, this technology looks very attractive. We will talk about fault tolerance methods and disk failure actions in our next article.

There are two RAID implementations: Hardware and Software RAID

Hardware RAID

The hardware controller manages the RAID subsystem independently of the processor and represents for it the entire RAID array as a single disk. For example, a hardware RAID array can connect to a SCSI controller, and it will look like a single SCSI drive. An external RAID array transfers RAID logic processing to a controller located in an external disk subsystem. The whole subsystem connects to the computer through a regular SCSI controller and looks like a single disk for it. RAID controllers are also often available in the form of boards, looking   for the operating system as a SCSI controller, but in addition they themselves work with disks. In such cases, you can connect the disks to the RAID controller as a regular SCSI controller, and then add them to the configuration of the RAID controller, while the operating system will never know the real configuration.

Software RAID

  Software support for various RAID levels is implemented in the kernel code for the disk (block device). This is the most affordable solution, as expensive hot-swap drive controller and chassis cards are not required. Software RAID works just as well with cheaper IDE drives as it does with SCSI drives. Given the speed of modern processors, the performance of software RAID arrays may exceed the performance of hardware RAID. The MD driver in the Linux kernel is an example of a RAID implementation that is completely hardware independent. The performance of the software array depends on the performance of the processor and its load. For information on configuring software RAID in the Red Hat Linux installer, see Chapter 5. For those who are interested in knowing what else software RAID can offer, the following is a short list of the most important features: The rebuild process supports threads. The implementation is completely in the kernel. The array can be transferred to other Linux systems without rebuilding. Array rebuild is performed in the background using free resources. systems Support for hot-swap drives Automatic CPU detection allows you to win using optimization

Hello to all readers site! Friends, I have long wanted to talk with you about how to create a RAID array on a computer (an excess array of independent disks). Despite the seeming complexity of the question, in fact, everything is very simple and I'm sure many readers will immediately adopt this article and will be happy to use this very useful technology related to the security of your data.

How to create RAID array and why is it needed

It is no secret that our information on the computer is practically insured by nothing and is located on a simple hard disk, which tends to break at the most inopportune moment. It has long been recognized that hDD   the weakest and most unreliable place in our system unit, since it has mechanical parts. Those users who have ever lost important data (including me) due to the failure of the “screw”, after burning for a while, ask themselves how to avoid such a nuisance in the future, and the first thing that comes to mind is rAID creation.

The whole point of an excess array of independent disks is to save your files on your hard drive in the event of a complete breakdown of this drive! How to do this, you ask, it’s very simple, you only need two (you can even have different in volume) hard drive.

In today's article, we will create using the Windows 8.1 operating system from two clean hard drives   the easiest and most popular RAID 1 array, it is also called "Mirroring" (mirroring). The meaning of the “mirror” is that information on both disks is duplicated (recorded in parallel) and two hard drives are exact copies of each other.

If you copied a file to the first hard drive, then the exact same file appears on the second one, and as you already understood, if one hard drive fails, then all your data will remain intact second hard drive (mirror). The probability of failure of two hard drives at once is negligible.

The only minus of the RAID 1 array is that you need to buy two hard drives, and they will work as one single one, that is, if you install two 500 GB hard drives in the system unit, then the same 500 will be available for storing files GB, not 1TB.

If one of the two hard drives fails, you just take and change it, adding as a mirror to the already installed hard drive with data and that's it.

Personally, I, for many years, use at work RAID 1 array of two hard drives of 1 TB each and a year ago a nuisance occurred, one "hard" ordered to live for a long time, I had to replace it right there, then I was horrified to think that if I didn’t have a RAID array, I ran a little chill on the back, because the data accumulated over several years of work would have disappeared, and so, I just replaced the faulty “terabyte” and continued to work. By the way, at home I also have a small RAID array of two 500 GB hard drives.

Creating softwareRAID 1 an array of two empty hard drives using Windows 8.1

First of all, we install two clean hard drives in our system unit. For an example, I will take two 250 GB hard disks.


What to do if the size of the hard drives is different or you already have information on the same hard drive, we read in our next article.

Open Disk Management

Disc 0   - SSD with operating system installed windows system   8.1 on the (C :) section.

Disc 1   and Disc 2 - hard disks   with a capacity of 250 GB of which we will assemble a RAID 1 array.

Right-click on any hard drive and select "Create Mirrored Volume"



Add a disk that will be a mirror for the previously selected disk. We selected Disk 1 as the first mirrored volume, so on the left side select Disk 2 and click on the Add button.



Select the letter of the software RAID 1 array, I leave the letter (D :). Further


We tick off the box Quick formatting and click Next.




In disk management, mirrored volumes are indicated by a blood-red color and have one drive letter, in our case (D :). Copy any files to any drive and they will immediately appear on another drive.


In the "This computer" window, software RAID 1 array appears as a single drive.


If one of the two hard drives fails, then the RAID array will be marked with a Failed Redundancy error in disk management, but all the data on the second hard drive will be safe.

In this article, I will review the possibilities for organizing RAID arrays using built-in tools. Windows server   and in detail about what pitfalls can occur during the creation and operation of such arrays.

Software RAID Features in Windows Server

The following arrays are supported:

  • striped volume (striped volume, RAID0)
  • mirrored volume (RAID1)
  • rAID5 volume
  • spanning volume (spanned volume, one logical volume is located on more than one physical disk)

Dynamic drives

RAID arrays can only be created on dynamic drives   - special layout of physical disks (only Windows understandable), which has the following features:

  • An ordinary (basic) disk can be converted to a dynamic disk only in its entirety.
  • Reverse conversion of a dynamic disk to a basic one is possible, but only if all volumes are deleted from the dynamic disk.
  • A dynamic disk is one large NTFS partition on which, using tricky overhead information, can be placed a large number of   volumes (both simple and RAID), it is possible to resize simple volumes   regular means of Windows. However, I do not know how optimally and fragmented the data will be.
  • The cloning, recovery, and resizing programs that I know of do not support dynamic disks.
  • Dynamic disks containing RAID volumes can be transferred to another Windows Server computer because they contain necessary information   for the correct assembly of the array.

Unable to create volumes with different RAID levels

Only one type (level) of RAID volume can be created on a single group of physical disks. For example, if we have 3 physical disks, and we created a RAID5 volume on them, without taking up all the space. We will not be able to create volumes of another RAID level (RAID0 and RAID1) in free space, but only RAID5 and simple volumes.

Synchronize volumes simultaneously

If several RAID volumes are created on the same disk group, then in the event of any failure after the computer boots up, they begin to recover at the same time. This is a fierce, furious EPIC FAIL! A simple situation: there are two physical disks, they created two RAID1 volumes, one for the operating system, the other for data.

This scheme works great until the first failure (the simplest types are a sudden power outage or blue screen) And then the horror comes. The operating system boots and at the same time starts simultaneously synchronizing both RAID1 volumes. Thus, physical disks get competing teams for intensive sequential operations   in three different physical areas at once. In this case, the mechanics of the disks wears out wildly, the cache is useless.

From the outside, this “fault tolerance” is as follows: the overall performance of the disk subsystem drops every 20 times, the OS itself boots up either after the synchronization of one of the volumes has finished (15 minutes, if it is small, 50 gig), or 20 minutes later and will be useless until end of synchronization of one of the volumes.

I consider the above behavior to be an unacceptable architectural miscalculation on the part of Microsoft and I am surprised that this problem has not been solved so far since the advent of software RAID in Windows 2000 Server.

If you find yourself in the described situation, then you should not wait for the OS to load and disk wear.

  1. Disconnect one of the physical drives.
  2. Boot into the OS at normal speed.
  3. Break the mirror by making RAID1 volumes simple.
  4. Reconnect the second drive.
  5. Create only one mirror for the volume you need.

RAID5

I will describe a scenario in which you cannot restore a degraded RAID5 array to a healthy state, even if all the conditions are provided for this.

  1. There is a RAID5 array of six drives (Disk1-Disk6).
  2. Among them there is one failed Disk1 (for example, a couple of megabytes cannot be read from a terabyte volume), but the operating system does not know about it yet and did not mark it as a failed one.
  3. For some reason, a working Disk2 was disconnected from the array.
  4. Following the logic of RAID5, if one drive fails, the array remains operational, such an array is marked as degraded, its speed drops sharply, and synchronization with a new healthy disk is required.
  5. Serviceable Disk2 is connected in place. The system recognizes it as failed. To synchronize the array, this failed disk   must be removed from the RAID5 array and determined to be empty.
  6. Everything is ready for array synchronization. We start the repair of the array (repair) on an empty Disk2.
  7. SUDDENLY synchronization stumbles upon reading errors on a really bad drive Disk1 and stops.
  8. The whole array remains degraded. Disk1 is marked as containing errors, Disk2 is marked as online, but due to interrupted synchronization it does not contain complete correct data.
  9. In the hope of recovery, a completely new healthy Disk7 is connected. Restoring the array to it starts.
  10. As a result, a healthy Disk2 is replaced with another healthy Disk7, but the synchronization is again interrupted when it finds an error on the failed disk Disk1.
  11. And so on in the loop.

There is nothing to be done except to copy data that is still being read and it is impossible to rebuild the entire array.

Not wanting to admit defeat, I tried to do the following things:

  • Synchronize the array with skipping read errors on Disk1 (after all, this is just megabytes of their whole terabyte). But Microsoft does not provide such an opportunity.
  • Rip sector-by-sector the entire failed Disk1 to another healthy disk using cloning software. However, the programs available to me with dynamic disks did not work.

An example of competent implementation of software RAID

The hardware and software implementation of the RAID controller, known as Intel Matrix Storage, and recently renamed Intel Rapid Storage (works on RAID versions of chipsets such as ICH9R, ICH10R), has been eliminated from the above disadvantages. Intel's hardware-software RAID provides many of the benefits of older RAID controllers:

  • the ability to identify hot-swap drives
  • the ability to create volumes of different RAID levels on one disk group
  • sequentially synchronizing and checking RAID volumes on a disk group

Its main drawback, in contrast to the fully hardware RAID controllers, remains the "software", from which it follows:

  • lack of built-in cache and the possibility of autonomous operation in case of an accident
  • completely dependent on the operating system and drivers
  • operations performed on the disk subsystem load the main processor and memory
  • lack of support for advanced computationally intensive RAID levels such as RAID6

useful links

  • What dynamic disks are - Windows IT Pro [quite old article]
  • The whole truth about dynamic disks - Hacker [read carefully, “all” truth is mixed with fables]