如何克隆LVM精简配置卷?

前端之家收集整理的这篇文章主要介绍了如何克隆LVM精简配置卷?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我google了很多次但找不到答案.我想要的是将LVM精简配置卷克隆到另一个瘦卷.

现在我知道dd可以克隆一个瘦卷,如下所示:

dd if = / dev / mapper / vg_thin01 of = / dev / mapper / vg_thin02 bs = 1M

但新的克隆量将是全尺寸!如何使其稀疏/稀疏?

(实际上,精简卷将用于Xen或KVM中的DomU存储)

解决方法

克隆精简卷就像获取待克隆卷的快照一样简单.使用精简卷时,快照和新卷实际上是相同的,具有不同的默认标志.

kernel docs

Once created,the user doesn’t have to worry about any connection
between the origin and the snapshot. Indeed the snapshot is no
different from any other thinly-provisioned device
and can be
snapshotted itself via the same method. It’s perfectly legal to
have only one of them active,and there’s no ordering requirement on
activating or removing them both. (This differs from conventional
device-mapper snapshots.)

因此,对精简配置卷进行快照创建CoW克隆是完全合法的.从man page开始:

Example
       Create first snapshot of an existing ThinLV:
       # lvcreate -n thin1s1 -s vg/thin1
原文链接:https://www.f2er.com/linux/398181.html

猜你在找的Linux相关文章