加入收藏 | 设为首页 | 会员中心 | 我要投稿 财气旺网 - 财气网 (https://www.caiqiwang.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

如何克隆LVM精简配置卷?

发布时间:2021-05-21 16:24:30 所属栏目:Linux 来源:网络整理
导读:我google了很多次但找不到答案.我想要的是将LVM精简配置卷克隆到另一个瘦卷. 现在我知道dd可以克隆一个瘦卷,如下所示: dd if = / dev / mapper / vg_thin01 of = / dev / mapper / vg_thin02 bs = 1M 但新的克隆量将是全尺寸!如何使其稀疏/稀疏? (实际上,

我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

(编辑:财气旺网 - 财气网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!