Este contenido no está disponible en el idioma seleccionado.
A.2. The dmsetup Command
The
dmsetup command is a command line wrapper for communication with the Device Mapper. For general system information about LVM devices, you may find the info, ls, status, and deps options of the dmsetup command to be useful, as described in the following subsections.
For information about additional options and capabilities of the
dmsetup command, see the dmsetup(8) man page.
A.2.1. The dmsetup info Command Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
The
dmsetup info device command provides summary information about Device Mapper devices. If you do not specify a device name, the output is information about all of the currently configured Device Mapper devices. If you specify a device, then this command yields information for that device only.
The
dmsetup info command provides information in the following categories:
Name- The name of the device. An LVM device is expressed as the volume group name and the logical volume name separated by a hyphen. A hyphen in the original name is translated to two hyphens. During standard LVM operations, you should not use the name of an LVM device in this format to specify an LVM device directly, but instead you should use the vg/lv alternative.
State- Possible device states are
SUSPENDED,ACTIVE, andREAD-ONLY. Thedmsetup suspendcommand sets a device state toSUSPENDED. When a device is suspended, all I/O operations to that device stop. Thedmsetup resumecommand restores a device state toACTIVE. Read Ahead- The number of data blocks that the system reads ahead for any open file on which read operations are ongoing. By default, the kernel chooses a suitable value automatically. You can change this value with the
--readaheadoption of thedmsetupcommand. Tables present- Possible states for this category are
LIVEandINACTIVE. AnINACTIVEstate indicates that a table has been loaded which will be swapped in when admsetup resumecommand restores a device state toACTIVE, at which point the table's state becomesLIVE. For information, see thedmsetupman page. Open count- The open reference count indicates how many times the device is opened. A
mountcommand opens a device. Event number- The current number of events received. Issuing a
dmsetup wait ncommand allows you to wait for the n'th event, blocking the call until it is received. Major, minor- Major and minor device number.
Number of targets- The number of segments that make up a device. For example, a linear device spanning 3 disks would have 3 targets. A linear device composed of the beginning and end of a disk, but not the middle would have 2 targets.
UUID- UUID of the device.
The following example shows partial output for the
dmsetup info command.
A.2.2. The dmsetup ls Command Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
You can list the device names of mapped devices with the
dmsetup ls command. You can list devices that have at least one target of a specified type with the dmsetup ls --target target_type command. For other options of the dmsetup ls command, see the dmsetup man page.
The following example shows the command to list the device names of currently configured mapped devices.
The following example shows the command to list the device names of currently configured mirror mappings.
LVM configurations that are stacked on multipath or other device mapper devices can be complex to sort out. The
dmsetup ls command provides a --tree option that displays dependencies between devices as a tree, as in the following example.
A.2.3. The dmsetup status Command Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
The
dmsetup status device command provides status information for each target in a specified device. If you do not specify a device name, the output is information about all of the currently configured Device Mapper devices. You can list the status only of devices that have at least one target of a specified type with the dmsetup status --target target_type command.
The following example shows the command to list the status of the targets in all currently configured mapped devices.
A.2.4. The dmsetup deps Command Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
The
dmsetup deps device command provides a list of (major, minor) pairs for devices referenced by the mapping table for the specified device. If you do not specify a device name, the output is information about all of the currently configured Device Mapper devices.
The following example shows the command to list the dependencies of all currently configured mapped devices.
The following example shows the command to list the dependencies only of the device
lock_stress-grant--02.1722:
dmsetup deps lock_stress-grant--02.1722
# dmsetup deps lock_stress-grant--02.1722
3 dependencies : (253, 33) (253, 32) (253, 31)