A.2. dmsetup 命令


dmsetup 命令是一个用来与设备映射器沟通的命令行封装器(wrapper)。对于 LVM 设备的一般系统信息,您可发现 dmsetup 命令的 infolsstatusdeps 选项是有用的,如以下部分所述。
有关 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
可能的设备状态是 SUSPENDEDACTIVEREAD-ONLYdmsetup suspend 命令将设备状态设定为 SUSPENDED。当挂起某个设备时,所有到那个设备的 I/O 操作都会停止。dmsetup resume 命令将设备状态恢复到 ACTIVE
Read Ahead
系统对任意正在进行读取操作的打开的文件提前读取的数据块的数目。模热情况下,内核会自动选择一个合适的值。您可使用 dmsetup 命令的 --readahead 选项更改这个值。
Tables present
Possible states for this category are LIVE and INACTIVE. An INACTIVE state indicates that a table has been loaded which will be swapped in when a dmsetup resume command restores a device state to ACTIVE, at which point the table's state becomes LIVE. For information, see the dmsetup man page.
Open count
打开参考计数指示该打开该设备的次数。mount 命令会打开一个设备。
Event number
The current number of events received. Issuing a dmsetup wait n command 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 命令的部分输出示例。
# dmsetup info
Name:              testgfsvg-testgfslv1
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      0
Major, minor:      253, 2
Number of targets: 2
UUID: LVM-K528WUGQgPadNXYcFrrf9LnPlUMswgkCkpgPIgYzSvigM7SfeWCypddNSWtNzc2N
...
Name:              VolGroup00-LogVol00
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        1
Event number:      0
Major, minor:      253, 0
Number of targets: 1
UUID: LVM-tOcS1kqFV9drb0X1Vr8sxeYP0tqcrpdegyqj5lZxe45JMGlmvtqLmbLpBcenh2L3
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat