Hey Kevin,<br>
Thanks for the response,<br>
<br>
I've read through the thread but I am not clear on a few issues,<br>
<br>
 Why is there a need to create a snapshot-origin, isnt the fact
that I create snapshot of a specific device, in my case root_master,
using the command : <br>
echo "0 <span class="q">4096128 snapshot  root_master /dev/loop0 p 8"| dmsetup create root_cow0 <br>
already monitors the origin device root_master for write operations?<br>
<br>
As far as I understood the COW/snapshot logic is the following:<br>
1) Snapshot device is created over some other dm device<br>
2) snapshot dm device is mounted.<br>
3) Any call to write() or othere rw syscalls issues a write to backing
store as defined during creation of snapshot device, and relevant
pointers updated.<br>
4) Read from mounted snapshot device, results in one of the following :
if data was modified since the snapshot its read from COW backing
device(transparently to end user) , if data was not modified from
snapshot creation, its read from origin dm device.<br>
<br>
<br>
In addition as I mentioned, I am able to mount the dm snapshot device,
and I am also able to perform write operations (even though the origin
device is on a readonly media).<br>
<br>
The problem I encountered is data corruption and is partial, all files are partially damaged or have corrupted parts.<br>
<br>
What am I missing?<br>
<br>
</span>P.S Is there a documentation reagrding varios targets and their table format<br>
P.P.S in snapshot creation, what does <p|n> mean.<br>
Thanks.<br>
<br>
<br><div><span class="gmail_quote">On 8/26/05, <b class="gmail_sendername">Kevin Corry</b> <<a href="mailto:kevcorry@us.ibm.com">kevcorry@us.ibm.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Jacob,<br><br>On Wed August 24 2005 12:01 pm, Jacob Broido wrote:<br>> ---------- Forwarded message ----------<br>> From: Jacob Broido <<a href="mailto:jacob.broido@gmail.com">jacob.broido@gmail.com</a>><br>
> Date: Aug 24, 2005 7:00 PM<br>> Subject: Re: [dm-devel] cow snapshot on cloop device<br>> To: Kevin Corry <<a href="mailto:kevcorry@us.ibm.com">kevcorry@us.ibm.com</a>><br>><br>> I am using dmsetup directly. and I do the following:
<br>> 1) Create an empty file that will be used as cow backing storage<br>> 2) losetup the backing file to /dev/loop0<br>> 3) create a snapshot of main root_device on /dev/loop0<br>> 4) mount the cow snapshot<br>
><br>><br>> Here is the info you requested:<br>> The kernel is a - <a href="http://2.6.11.10">2.6.11.10</a> <<a href="http://2.6.11.10">http://2.6.11.10</a>> + xen patch.<br>> =======================================================
<br>> / # dmsetup ls<br>> root_master (253, 0)<br>> root_cow0 (253, 1)<br>> / # dmsetup table<br>> root_master: 0 4096128 linear 240:0 0<br>> root_cow0: 0 4096128 snapshot 253:0 7:0 P 8<br><br>Ok, this is not going to do what you're expecting it to do. In order to use
<br>snapshotting, you need a snapshot device, and you also need a snapshot-origin<br>device. The snapshot-origin code is what monitors the I/O path for the origin<br>device, and performs the copy-on-writes as necessary.<br>
<br>Last summer I did a write-up how you might use dmsetup to create snapshots.<br>You can read the thread at:<br><a href="https://www.redhat.com/archives/dm-devel/2004-July/msg00068.html">https://www.redhat.com/archives/dm-devel/2004-July/msg00068.html
</a><br><br>But in short, it's vastly simpler to just use LVM2 or EVMS to create<br>snapshots. You should be able to create volumes on your cloop devices using<br>either set of tools.<br><br>Let me know if you have additional questions after reading through the thread
<br>above.<br><br>--<br>Kevin Corry<br><a href="mailto:kevcorry@us.ibm.com">kevcorry@us.ibm.com</a><br><a href="http://www.ibm.com/linux/">http://www.ibm.com/linux/</a><br><a href="http://evms.sourceforge.net/">http://evms.sourceforge.net/
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Not gonna be king of the world if you're slave to the grind<br>- Skid Row