找出快照精简卷上的已用空间

gud*_*dge 5 lvm snapshot thin-provisioning

我有以下 lvm 配置。

Hard Disk: /dev/sdb  (Size 10 GB)
VG: vg_root on /dev/sdb
THIN_POOL thin_pool occupying the whole physical extent
lvcreate -y --extents 100%free --thin vg_root/thin_pool

Thin volume on the thin pool
lvcreate --name lv_1 --virtualsize 1GB --thinpool vg_root/thin_pool

Another thin volume on the thin_pool
lvcreate --name lv_2 --virtualsize 2GB --thinpool vg_root/thin_pool
mount and create a file of 1 GB on the volume

Snapshot volume for lv_2
lvcreate -y --setactivationskip n --snapshot --thinpool vg_root/thin_pool vg_root/lv_2 --name snapshot_1
mount and create a file of 250MB on the volume
Run Code Online (Sandbox Code Playgroud)

我假设 snapshot_1 实际使用的空间是 250MB 而不是 (1GB + 250MB)。有没有办法找出 snapshot_1 (250 MB) 上实际使用的物理空间。

thin_dump -f xml /dev/mapper/vg_root_thin_pool_tmeta
Run Code Online (Sandbox Code Playgroud)

我将继续讨论相同的问题,因为这些可以链接。如果需要分开下一个问题,请告诉我:

转储有关逻辑卷的信息。

 begin superblock: "", 3, 8, 128, 326976
 device: 1
 mapped_blocks: 60
 transaction: 0
 creation time: 0
 snap time: 0
    (0..1) -> (0..1), 0
    2047 -> 58, 0
    4094 -> 57, 0
    6141 -> 52, 0
Run Code Online (Sandbox Code Playgroud)

我们如何将设备 ID 映射到 lvm 卷?