Disk mirroring explained

In data storage, disk mirroring is the replication of logical disk volumes onto separate physical hard disks in real time to ensure continuous availability. It is most commonly used in RAID 1. A mirrored volume is a complete logical representation of separate volume copies.

In a disaster recovery context, mirroring data over long distance is referred to as storage replication. Depending on the technologies used, replication can be performed synchronously, asynchronously, semi-synchronously, or point-in-time. Replication is enabled via microcode on the disk array controller or via server software. It is typically a proprietary solution, not compatible between various data storage device vendors.

Mirroring is typically only synchronous. Synchronous writing typically achieves a recovery 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 from file shadowing that operates on the file level, and disk snapshots where data images are never re-synced with their origins.

Overview

Typically, mirroring is provided in either hardware solutions such as disk arrays, or in software within the operating system (such as Linux mdadm and device mapper).[1] [2] Additionally, file systems like Btrfs or ZFS 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 a hot 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 a hot 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 called rebuilding 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.

Additional benefits

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.

See also

Notes and References

  1. Web site: ANNOUNCE: mdadm 3.3 - A tools for managing md Soft RAID under Linux . 2013-09-03 . 2013-11-20 . gmane.org . https://web.archive.org/web/20140821023250/http://article.gmane.org/gmane.linux.raid/44013 . 2014-08-21 .
  2. Web site: Logical Volume Manager Administration . Appendix A. The Device Mapper . 2013-09-29 . Red Hat.
  3. Web site: Using Btrfs with Multiple Devices . 2013-11-07 . 2013-11-20 . kernel.org.
  4. Web site: Actually it's a n-way mirror . 2013-09-04 . 2013-11-20 . c0t0d0s0.org . 2013-09-14 . https://web.archive.org/web/20130914022916/http://www.c0t0d0s0.org/archives/7642-Actually-its-a-n-way-mirror.html .
  5. Web site: A Conversation with Chris Mason on BTRfs: the next generation file system for Linux . https://web.archive.org/web/20120627065427/http://www.linuxfoundation.org/news-media/blogs/browse/2009/06/conversation-chris-mason-btrfs-next-generation-file-system-linux . 27 June 2012 . Amanda . McPherson . 22 June 2009 . 2013-11-22 . Linux Foundation.
  6. Web site: Why Is It Called 'Resilvering'? . The Lone SysAdmin . 23 March 2012 . 2013-09-19 .