All of lore.kernel.org
 help / color / mirror / Atom feed
* cow snapshot on cloop device
@ 2005-08-24 11:35 Jacob Broido
  2005-08-24 13:58 ` Kevin Corry
  0 siblings, 1 reply; 5+ messages in thread
From: Jacob Broido @ 2005-08-24 11:35 UTC (permalink / raw)
  To: dm-devel


[-- Attachment #1.1: Type: text/plain, Size: 514 bytes --]

Hi,
I am trying to set a cow snapshot on a cloop device.
I managed to create a snapshot and mount it as read/write, but it appears 
that the data inside the /cloop appears invalid:

Binary executables appear to be invalid, I perfomed diff between files on 
snapshotted /dev/cloop, and the same files accessed directly through cloop.

The files were diffrent,
anyone has idea as to what can be the reason for this?

Thanks

-- 
Not gonna be king of the world if you're slave to the grind
- Skid Row

[-- Attachment #1.2: Type: text/html, Size: 568 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: cow snapshot on cloop device
  2005-08-24 11:35 cow snapshot on cloop device Jacob Broido
@ 2005-08-24 13:58 ` Kevin Corry
       [not found]   ` <6262291505082410002ca214a9@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Corry @ 2005-08-24 13:58 UTC (permalink / raw)
  To: dm-devel; +Cc: Jacob Broido

On Wed August 24 2005 11:35 am, Jacob Broido wrote:
> Hi,
> I am trying to set a cow snapshot on a cloop device.
> I managed to create a snapshot and mount it as read/write, but it appears
> that the data inside the /cloop appears invalid:
>
> Binary executables appear to be invalid, I perfomed diff between files on
> snapshotted /dev/cloop, and the same files accessed directly through cloop.
>
> The files were diffrent,
> anyone has idea as to what can be the reason for this?

Are you using LVM, EVMS, or dmsetup to create your snapshot? Please send in 
the output from "dmsetup ls" and "dmsetup table", as well as the contents 
of /proc/partitions and /proc/mounts, after you have activated and mounted 
your snapshot.

-- 
Kevin Corry
kevcorry@us.ibm.com
http://www.ibm.com/linux/
http://evms.sourceforge.net/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Fwd: cow snapshot on cloop device
       [not found]   ` <6262291505082410002ca214a9@mail.gmail.com>
@ 2005-08-24 17:01     ` Jacob Broido
  2005-08-26  0:02       ` Kevin Corry
  0 siblings, 1 reply; 5+ messages in thread
From: Jacob Broido @ 2005-08-24 17:01 UTC (permalink / raw)
  To: dm-devel


[-- Attachment #1.1: Type: text/plain, Size: 2352 bytes --]

---------- Forwarded message ----------
From: Jacob Broido <jacob.broido@gmail.com>
Date: Aug 24, 2005 7:00 PM
Subject: Re: [dm-devel] cow snapshot on cloop device
To: Kevin Corry <kevcorry@us.ibm.com>

I am using dmsetup directly. and I do the following:
1) Create an empty file that will be used as cow backing storage
2) losetup the backing file to /dev/loop0
3) create a snapshot of main root_device on /dev/loop0
4) mount the cow snapshot


Here is the info you requested:
The kernel is a - 2.6.11.10 <http://2.6.11.10> + xen patch.
=======================================================
/ # dmsetup ls
root_master (253, 0)
root_cow0 (253, 1)
/ # dmsetup table
root_master: 0 4096128 linear 240:0 0 
root_cow0: 0 4096128 snapshot 253:0 7:0 P 8

/ # cat /proc/partitions

major minor #blocks name

7 0 loop0
8 0 sda
8 1 sda1
8 2 sda2
8 3 sda3
240 0 cloop0
252 0 dm-0
253 1 dm-1

/ # cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root.old / ext2 rw 0 0
/proc /proc proc rw,noadirtime 0 0
/sys /sys sysfs rw 0 0
/dev/hdc /cdrom iso9660 ro 0 0
/ramdisk /ramdisk tmpfs rw 0 0
/dev/mapper/root_cow0 /cow ext2 rw.noatime 0 0
====================================================

On 8/24/05, Kevin Corry <kevcorry@us.ibm.com> wrote: 
> 
> On Wed August 24 2005 11:35 am, Jacob Broido wrote:
> > Hi,
> > I am trying to set a cow snapshot on a cloop device. 
> > I managed to create a snapshot and mount it as read/write, but it 
> appears
> > that the data inside the /cloop appears invalid:
> >
> > Binary executables appear to be invalid, I perfomed diff between files 
> on 
> > snapshotted /dev/cloop, and the same files accessed directly through 
> cloop.
> >
> > The files were diffrent,
> > anyone has idea as to what can be the reason for this?
> 
> Are you using LVM, EVMS, or dmsetup to create your snapshot? Please send 
> in 
> the output from "dmsetup ls" and "dmsetup table", as well as the contents
> of /proc/partitions and /proc/mounts, after you have activated and mounted
> your snapshot.
> 
> --
> Kevin Corry
> kevcorry@us.ibm.com
> http://www.ibm.com/linux/
> http://evms.sourceforge.net/
> 



-- 
Not gonna be king of the world if you're slave to the grind
- Skid Row 


-- 
Not gonna be king of the world if you're slave to the grind
- Skid Row

[-- Attachment #1.2: Type: text/html, Size: 4200 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fwd: cow snapshot on cloop device
  2005-08-24 17:01     ` Fwd: " Jacob Broido
@ 2005-08-26  0:02       ` Kevin Corry
  2005-08-26  1:51         ` Jacob Broido
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Corry @ 2005-08-26  0:02 UTC (permalink / raw)
  To: dm-devel; +Cc: Jacob Broido

Hi Jacob,

On Wed August 24 2005 12:01 pm, Jacob Broido wrote:
> ---------- Forwarded message ----------
> From: Jacob Broido <jacob.broido@gmail.com>
> Date: Aug 24, 2005 7:00 PM
> Subject: Re: [dm-devel] cow snapshot on cloop device
> To: Kevin Corry <kevcorry@us.ibm.com>
>
> I am using dmsetup directly. and I do the following:
> 1) Create an empty file that will be used as cow backing storage
> 2) losetup the backing file to /dev/loop0
> 3) create a snapshot of main root_device on /dev/loop0
> 4) mount the cow snapshot
>
>
> Here is the info you requested:
> The kernel is a - 2.6.11.10 <http://2.6.11.10> + xen patch.
> =======================================================
> / # dmsetup ls
> root_master (253, 0)
> root_cow0 (253, 1)
> / # dmsetup table
> root_master: 0 4096128 linear 240:0 0
> root_cow0: 0 4096128 snapshot 253:0 7:0 P 8

Ok, this is not going to do what you're expecting it to do. In order to use 
snapshotting, you need a snapshot device, and you also need a snapshot-origin 
device. The snapshot-origin code is what monitors the I/O path for the origin 
device, and performs the copy-on-writes as necessary.

Last summer I did a write-up how you might use dmsetup to create snapshots. 
You can read the thread at:
https://www.redhat.com/archives/dm-devel/2004-July/msg00068.html

But in short, it's vastly simpler to just use LVM2 or EVMS to create 
snapshots. You should be able to create volumes on your cloop devices using 
either set of tools.

Let me know if you have additional questions after reading through the thread 
above.

-- 
Kevin Corry
kevcorry@us.ibm.com
http://www.ibm.com/linux/
http://evms.sourceforge.net/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fwd: cow snapshot on cloop device
  2005-08-26  0:02       ` Kevin Corry
@ 2005-08-26  1:51         ` Jacob Broido
  0 siblings, 0 replies; 5+ messages in thread
From: Jacob Broido @ 2005-08-26  1:51 UTC (permalink / raw)
  To: Kevin Corry; +Cc: dm-devel


[-- Attachment #1.1: Type: text/plain, Size: 3458 bytes --]

Hey Kevin,
Thanks for the response,

I've read through the thread but I am not clear on a few issues,

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 : 
echo "0 4096128 snapshot root_master /dev/loop0 p 8"| dmsetup create 
root_cow0 
already monitors the origin device root_master for write operations?

As far as I understood the COW/snapshot logic is the following:
1) Snapshot device is created over some other dm device
2) snapshot dm device is mounted.
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.
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.


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).

The problem I encountered is data corruption and is partial, all files are 
partially damaged or have corrupted parts.

What am I missing?

P.S Is there a documentation reagrding varios targets and their table format
P.P.S in snapshot creation, what does <p|n> mean.
Thanks.


On 8/26/05, Kevin Corry <kevcorry@us.ibm.com> wrote:
> 
> Hi Jacob,
> 
> On Wed August 24 2005 12:01 pm, Jacob Broido wrote:
> > ---------- Forwarded message ----------
> > From: Jacob Broido <jacob.broido@gmail.com>
> > Date: Aug 24, 2005 7:00 PM
> > Subject: Re: [dm-devel] cow snapshot on cloop device
> > To: Kevin Corry <kevcorry@us.ibm.com>
> >
> > I am using dmsetup directly. and I do the following:
> > 1) Create an empty file that will be used as cow backing storage
> > 2) losetup the backing file to /dev/loop0
> > 3) create a snapshot of main root_device on /dev/loop0
> > 4) mount the cow snapshot
> >
> >
> > Here is the info you requested:
> > The kernel is a - 2.6.11.10 <http://2.6.11.10> <http://2.6.11.10> + xen 
> patch.
> > =======================================================
> > / # dmsetup ls
> > root_master (253, 0)
> > root_cow0 (253, 1)
> > / # dmsetup table
> > root_master: 0 4096128 linear 240:0 0
> > root_cow0: 0 4096128 snapshot 253:0 7:0 P 8
> 
> Ok, this is not going to do what you're expecting it to do. In order to 
> use
> snapshotting, you need a snapshot device, and you also need a 
> snapshot-origin
> device. The snapshot-origin code is what monitors the I/O path for the 
> origin
> device, and performs the copy-on-writes as necessary.
> 
> Last summer I did a write-up how you might use dmsetup to create 
> snapshots.
> You can read the thread at:
> https://www.redhat.com/archives/dm-devel/2004-July/msg00068.html
> 
> But in short, it's vastly simpler to just use LVM2 or EVMS to create
> snapshots. You should be able to create volumes on your cloop devices 
> using
> either set of tools.
> 
> Let me know if you have additional questions after reading through the 
> thread
> above.
> 
> --
> Kevin Corry
> kevcorry@us.ibm.com
> http://www.ibm.com/linux/
> http://evms.sourceforge.net/
> 



-- 
Not gonna be king of the world if you're slave to the grind
- Skid Row

[-- Attachment #1.2: Type: text/html, Size: 4288 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-26  1:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-24 11:35 cow snapshot on cloop device Jacob Broido
2005-08-24 13:58 ` Kevin Corry
     [not found]   ` <6262291505082410002ca214a9@mail.gmail.com>
2005-08-24 17:01     ` Fwd: " Jacob Broido
2005-08-26  0:02       ` Kevin Corry
2005-08-26  1:51         ` Jacob Broido

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.