如何扩展上面有快照的逻辑卷

How to extend a logical volume which has snapshot on it

我有一个 lv(逻辑卷),它是另一个快照的原始来源。我想用命令 'lvextend' 扩展 lv,第一次尝试失败并出现错误:

Snapshot origin volumes can be resized only while inactive

所以我用命令序列尝试了第二种方法。

1. unmount [mount_path]
2. deactive the device with command(lvchange -an [device_path])
3. lvextend [device_path]

然后我得到错误:

LV [device_namr] has open snapshot [snapshot_name]: not deactivating

我该怎么办,如何扩展存在快照的 lv?

您也必须停用您的快照,使用命令:

lvchange -an [snapshot_path]

并且当卷和快照都处于非活动状态时,您可以扩展您的卷。

您不需要停用安装到 / 的卷,您可以调整它的大小以在安装卷时占用磁盘上的空 space mounted

  1. 要停用快照,请执行
    lvchange -an /path/to/snapshot
  2. 要扩展映射到 / 的卷,请使用 lvextend
  3. --resizefs 选项