[linux-lvm] Snapshots and disk re-use

Nataraj incoming-centos at rjl.com
Thu Feb 24 19:15:52 UTC 2011


On 02/24/2011 08:41 AM, Jonathan Tripathy wrote:
>
> On 24/02/11 15:20, Jonathan Tripathy wrote:
>>
>> On 24/02/11 15:13, Stuart D. Gathman wrote:
>>> On Thu, 24 Feb 2011, Jonathan Tripathy wrote:
>>>
>>>>> Yes. To be more pedantic, the COW has copies of the original contents
>>>>> of blocks written to the origin since the snapshot.  That is why you
>>>>> need to clear it to achieve your stated purpose.  The origin blocks
>>>>> are written normally to the *-real volume (you can see these in
>>>>> the /dev/mapper directory).
>>>> But didn't you say that there is only one copy of the files stored
>>>> physically
>>>> on disk?
>>> Yes.  When you make the snapshot, there is only one copy, and the
>>> COW table
>>> is empty.  AS YOU WRITE to the origin, each chunk written is saved to
>>> *-cow first before being written to *-real.
>> Got ya. So data that is being written to the origin, while the
>> snapshot exists, is the data that may leak, as it's saved to the COW
>> first, then copied over to real.
>>
>> Hopefully an expert will let me know weather its safe to zero the COW
>> after I’ve finished with the snapshot.
>>
>>
> Oh, I forgot to mention. My LVM sits on top of linux software RAID1.
> Does that complicate things at all?
>

One other thing that wasn't mentioned here.... As far as I understand,
if these are lvms on the host and the snapshots are being taken on the
host, there is no guaranteed integrity of the filesystems unless you
shutdown the guest while the snapshot is taken.

It's too bad they don't implement a system call that could do something
like sync filesystem and sleep until I tell you to continue.  This would
be perfect for snapshot backups of virtual hosts.

Nataraj




More information about the linux-lvm mailing list