Crate devicemapper [−] [src]
Low-level devicemapper configuration of the running kernel.
Linux's devicemapper allows the creation of block devices whose storage is mapped to other block devices in useful ways, either by changing the location of its data blocks, or performing some operation on the data itself. This is a low-level facility that is used by higher-level volume managers such as LVM2. Uses may include:
- Dividing a large block device into smaller logical volumes (dm-linear)
- Combining several separate block devices into a single block device with better performance and/or redundancy (dm-raid)
- Encrypting a block device (dm-crypt)
- Performing Copy-on-Write (COW) allocation of a volume's blocks enabling fast volume cloning and snapshots (dm-thin)
- Configuring a smaller, faster block device to act as a cache for a larger, slower one (dm-cache)
- Verifying the contents of a read-only volume (dm-verity)
Before they can be used, DM devices must be created using
DM::device_create(), have a mapping table loaded using
DM::table_load(), and then activated with
DM::device_suspend(). (This function is used for both suspending
and activating a device.) Once activated, they can be used as a
regular block device, including having other DM devices map to
Devices have "active" and "inactive" mapping tables. See function descriptions for which table they affect.
Context needed for communicating with devicemapper.
A struct containing the device's major and minor numbers
Contains information about the device.
Flags used by devicemapper.
Used as a parameter for functions that take either a Device name or a Device UUID.
Out: Active table is present.
Out: Passed-in buffer was too small.
Out: A message generated output data.
In: Do not remove in-use devices. Out: Device scheduled to be removed when closed.
Out: Inactive table is present.
Out: Device is suspended internally.
In: Suspend without flushing queued I/Os.
In: Use passed-in minor number.
In: Query inactive table instead of active.
In: Device should be read-only. Out: Device is read-only.
In: All buffers are wiped after use. Use when handling crypto keys.
In: Avoid freezing filesystem when suspending.
In: STATUS command returns table info instead of status.
In: Device should be suspended. Out: Device is suspended.
Out: A uevent was generated, the caller may need to wait for it.
In: Rename affects UUID field, not name field.
Major numbers used by DM.
This 4-tuple consists of starting offset (sectors), length (sectors), target type (string, e.g. "linear"), and params(string). See target documentation for the format of each target type's params field.