[linux-lvm] Snapshots

jonr at destar.net jonr at destar.net
Thu Sep 10 23:25:10 UTC 2009


Hello List,

I don't get it!

I have a xen system that has a DomU of FC11 with a 20GB LV for the  
disk. I created a snapshot using this command:

lvcreate -L +10G -s -n s_cgate-be1 /dev/xenvg/cgate-be1

This is the output of an 'lvdisplay' of the snapshot LV:

lvdisplay /dev/xenvg/s_cgate-be1
   --- Logical volume ---
   LV Name                /dev/xenvg/s_cgate-be1
   VG Name                xenvg
   LV UUID                7c1kEs-xYoO-Qxem-2E2M-hlee-pc4Q-zm6TZ5
   LV Write Access        read/write
   LV snapshot status     active destination for /dev/xenvg/cgate-be1
   LV Status              available
   # open                 2
   LV Size                20.00 GB
   Current LE             5120
   COW-table size         10.00 GB
   COW-table LE           2560
   Allocated to snapshot  0.11%
   Snapshot chunk size    4.00 KB
   Segments               1
   Allocation             inherit
   Read ahead sectors     auto
   - currently set to     256
   Block device           253:15

I then shutdown the DomU and pointed the 'Disk...' line in the config  
file for the DomU to the snapshot. It boots.

OK, I must be missing the simple answer because I cannot seem to grasp  
the concept of snapshots.


1. How can I have a 20GB LV as a disk and the snapshot be 10GB and  
boot the entire OS?

2. Can I create a DomU and then snapshot the LV and use the snapshot  
to create other DomU's?

3. If 2 is yes, would I want to continue using the snapshot as the  
disk or is there something else that should be done, i.e. dd the drive  
to a new LV?

In the 'lvdisplay' of the snapshot I have these extra lines:
   LV snapshot status     active destination for /dev/xenvg/cgate-be1
   # open                 2
   COW-table size         10.00 GB
   COW-table LE           2560
   Allocated to snapshot  0.11%
   Snapshot chunk size    4.00 KB

4. Does the 0.11% mean that the 10GB snapshot file is only using .11%  
of the 10GB LV?


If there is a good doc out there explaining all of this could someone  
just post a link. I don't mind reading but am not getting the answers  
to the above. I have found lots of docs explaining how to do it but  
nothing going much further than that.

Thanks for any help,

Jon





More information about the linux-lvm mailing list