The Device Mapper; Device Table Mappings - Red Hat ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION Manual

Hide thumbs Also See for ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION:
Table of Contents

Advertisement

Appendix A. The Device Mapper
The Device Mapper is a kernel driver that provides a framework for volume management. It provides
a generic way of creating mapped devices, which may be used as logical volumes. It does not
specifically know about volume groups or metadata formats.
The Device Mapper provides the foundation for a number of higher-level technologies. In addition to
LVM, Device-Mapper multipath and the dmraid command use the Device Mapper. The application
interface to the Device Mapper is the ioctl system call. The user interface is the dmsetup
command.
LVM logical volumes are activated using the Device Mapper. Each logical volume is translated into a
mapped device. Each segment translates into a line in the mapping table that describes the device.
The Device Mapper supports a variety of mapping targets, including linear mapping, striped mapping,
and error mapping. So, for example, two disks may be concatenated into one logical volume with a
pair of linear mappings, one for each disk. When LVM2 creates a volume, it creates an underlying
device-mapper device that can be queried with the dmsetup command. For information about the
Section A.1, "Device Table
Mappings". For information about
format of devices in a mapping table, see
Section A.2, "The dmsetup
Command".
using the dmsetup command to query a device, see
A.1. Device Table Mappings
A mapped device is defined by a table that specifies how to map each range of logical sectors of the
device using a supported Device Table mapping. The table for a mapped device is constructed from a
list of lines of the form:
start length mapping [mapping_parameters...]
In the first line of a Device Mapper table, the start parameter must equal 0. The start + length
parameters on one line must equal the start on the next line. Which mapping parameters are
specified in a line of the mapping table depends on which mapping type is specified on the line.
Sizes in the Device Mapper are always specified in sectors (512 bytes).
When a device is specified as a mapping parameter in the Device Mapper, it can be referenced by
the device name in the filesystem (for example, /dev/hda) or by the major and minor numbers in the
format major:minor. The major:minor format is preferred because it avoids pathname lookups.
The following shows a sample mapping table for a device. In this table there are four linear targets:
0 35258368 linear 8:48 65920
35258368 35258368 linear 8:32 65920
70516736 17694720 linear 8:16 17694976
88211456 17694720 linear 8:16 256
The first 2 parameters of each line are the segment starting block and the length of the segment. The
next keyword is the mapping target, which in all of the cases in this example is linear. The rest of
the line consists of the parameters for a linear target.
79

Advertisement

Table of Contents
loading

Table of Contents