A.2. dmsetup 命令
dmsetup 命令是一个用来与设备映射器沟通的命令行封装器(wrapper)。对于 LVM 设备的一般系统信息,您可发现 dmsetup 命令的 info、ls、status 和 deps 选项是有用的,如以下部分所述。
有关
dmsetup 命令的额外选项和功能,请参考 dmsetup(8) man page。
A.2.1. dmsetup info 命令 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
dmsetup info device 命令提供有关设备映射器设备概述。如果您没有指定设备名称,则输出所余目前配置的设备映射器设备信息。如果您指定了一个设备,那么这个命令只会生成那个设备的信息。
dmsetup info 命令提供以下分类中的信息:
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- 可能的设备状态是
SUSPENDED、ACTIVE和READ-ONLY。dmsetup suspend命令将设备状态设定为SUSPENDED。当挂起某个设备时,所有到那个设备的 I/O 操作都会停止。dmsetup resume命令将设备状态恢复到ACTIVE。 Read Ahead- 系统对任意正在进行读取操作的打开的文件提前读取的数据块的数目。模热情况下,内核会自动选择一个合适的值。您可使用
dmsetup命令的--readahead选项更改这个值。 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- 打开参考计数指示该打开该设备的次数。
mount命令会打开一个设备。 Event number- The current number of events received. Issuing a
dmsetup wait ncommand allows the user to wait for the n'th event, blocking the call until it is received. Major, minor- 主设备号码和副设备号码
Number of targets- 组成一个设备的片段数目。例如:一个跨越三个磁盘的线性设备会有三个对象。由一个磁盘起始和结尾,而不是中间组成的线性设备有两个设备。
UUID- 该设备的 UUID。
以下是
dmsetup info 命令的部分输出示例。