I have the following lvm configuration.

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

I assume the actual used space by snapshot_1 will be 250MB and not (1GB + 250MB). Is there a way to figure out the actual physical used space on snapshot_1 (250 MB).

thin_dump -f xml /dev/mapper/vg_root_thin_pool_tmeta

I will continue with on the same question, as these could be linked. Let me know if need to seperate out the next question:

dumps information about the logical volumes.

 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

How do we map the device id to the lvm volume ?

  • 1
    lvs will tell you how much space each is using.
    – psusi
    Commented Nov 1, 2015 at 23:38
  • @psusi : I just see the virtual size with lvs. Could you please let me know the exact command.
    – gudge
    Commented Nov 1, 2015 at 23:40
  • Look at the column labeled "data %"
    – psusi
    Commented Nov 2, 2015 at 23:43
  • data % is inherited from origin volume. so - if origin volume is 50% full, every snapshot of it will be 50% full too - even if it doesn't occupy any blocks more.
    – undefine
    Commented Jan 2, 2017 at 8:31
  • @undefine not true. Data% column represents the "allocated to snapshot" size. it's confirmed by lvdisplay "Allocated to snapshot" property that will have the very same value. You can see it starting at 0.00% and growing as the time passes by Commented Aug 1, 2017 at 10:36


You must log in to answer this question.

Browse other questions tagged .