如何克隆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

相关文章

linux常用进程通信方式包括管道(pipe)、有名管道(FIFO)、...
Linux性能观测工具按类别可分为系统级别和进程级别,系统级别...
本文详细介绍了curl命令基础和高级用法,包括跳过https的证书...
本文包含作者工作中常用到的一些命令,用于诊断网络、磁盘占满...
linux的平均负载表示运行态和就绪态及不可中断状态(正在io)的...
CPU上下文频繁切换会导致系统性能下降,切换分为进程切换、线...