Device mapper works by passing data from a virtual block device, which is provided by the device mapper itself, to another block device. Data can be also modified in transition, which is performed, for example, in the case of device mapper providingdisk encryption or simulation of unreliable hardware behavior.
This article focuses on the device mapper implementation in the Linux kernel, but the device mapper functionality is also available in bothNetBSD andDragonFly BSD.[2][3]
The position of the device mapper targets within various layers of theLinux kernel's storage stack.[8]
Functions provided by the device mapper include linear, striped and errormappings, as well as crypt and multipathtargets. For example, two disks may be concatenated into one logical volume with a pair oflinear mappings, one for each disk. As another example,crypt target encrypts the data passing through the specified device, by using the Linux kernel'sCrypto API.[1]
As of 2014[update], the following mapping targets are available:[1][5]
dm-integrity – mapping target that providesdata integrity, either using checksumming or cryptographic verification,[10][11] also used with LUKS[12]
dm-log-writes – mapping target that uses two devices, passing through the first device and logging the write operations performed to it on the second device[13]
dm-verity – validates the data blocks contained in a file system against a list of cryptographic hash values, developed as part of theChromiumOS project[14]