如何扩展具有快照的逻辑卷

时间:2017-02-08 16:51:39

标签: storage openstack lvm

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

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?

2 个答案:

答案 0 :(得分:1)

您还必须使用以下命令停用快照:

lvchange -an [snapshot_path]

当音量和快照都处于非活动状态时,您可以扩展音量。

答案 1 :(得分:0)

您无需停用已挂载到/的卷,您可以调整其大小以在挂载卷时占用磁盘上的空白空间

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