This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Disk mirroring" – news ·newspapers ·books ·scholar ·JSTOR(September 2013) (Learn how and when to remove this message) |

Indata storage,disk mirroring is thereplication oflogical disk volumes onto separate physicalhard disks inreal time to ensurecontinuous availability. It is most commonly used inRAID 1. Amirrored volume is a complete logical representation of separate volume copies.
In adisaster recovery context, mirroring data over long distance is referred to asstorage replication. Depending on the technologies used, replication can be performedsynchronously,asynchronously, semi-synchronously, or point-in-time. Replication is enabled viamicrocode on thedisk array controller or viaserversoftware. It is typically a proprietary solution, not compatible between various data storage device vendors.
Mirroring is typically only synchronous. Synchronous writing typically achieves arecovery point objective (RPO) of zero lost data. Asynchronous replication can achieve an RPO of just a few seconds while the remaining methodologies provide an RPO of a few minutes to perhaps several hours.
Disk mirroring differs fromfile shadowing that operates on the file level, anddisk snapshots where data images are never re-synced with their origins.
Typically, mirroring is provided in either hardware solutions such asdisk arrays, or in software within the operating system (such as Linuxmdadm anddevice mapper).[1][2] Additionally,file systems likeBtrfs orZFS provide integrated data mirroring.[3][4] There are additional benefits from Btrfs and ZFS, which maintain both data and metadata integrity checksums, making themselves capable of detecting bad copies of blocks, and using mirrored data to pull up data from correct blocks.[5]
There are several scenarios for what happens when a disk fails. In ahot swap system, in the event of a disk failure, the system itself typically diagnoses a disk failure and signals a failure. Sophisticated systems may automatically activate ahot standby disk and use the remaining active disk to copy live data onto this disk. Alternatively, a new disk is installed and the data is copied to it. In less sophisticated systems, the system is operated on the remaining disk until a spare disk can be installed.
The copying of data from one side of a mirror pair to another is calledrebuilding or, less commonly,resilvering.[6]
Mirroring can be performed site to site either by rapid data links, for example fibre optic links, which over distances of 500 m or so can maintain adequate performance to support real-time mirroring. Longer distances or slower links maintain mirrors using an asynchronous copying system. For remote disaster recovery systems, this mirroring may not be done by integrated systems but simply by additional applications on primary and secondary machines.
In addition to providing an additional copy of the data for the purpose of redundancy in case of hardware failure, disk mirroring can allow each disk to be accessed separately for reading purposes. Under certain circumstances, this can significantly improve performance as the system can choose for each read which disk can seek most quickly to the required data. This is especially significant where there are several tasks competing for data on the same disk, and thrashing (where the switching between tasks takes up more time than the task itself) can be reduced. This is an important consideration in hardware configurations that frequently access the data on the disk.