All of lore.kernel.org
 help / color / mirror / Atom feed
* write directly to device mapper snapshot origin device ?
@ 2016-07-14 14:25 Navin P.S
  2016-07-15  8:29 ` Navin P.S
  0 siblings, 1 reply; 9+ messages in thread
From: Navin P.S @ 2016-07-14 14:25 UTC (permalink / raw)
  To: dm-devel

Hi,
  Can i do dd if=/dev/zero of=/dev/mapper/dmo count=20 ? where dmo is
a dm snapshot origin created through dmsetup command. Instead of
/dev/zero i can write valid devices.

I could create the dmo through some lvm2 commands. Is direct write
with 4k (page size values ) allowed when it is mapped to 2 block
devices in linear mode ?


Regards,
-- Navin

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

* Re: write directly to device mapper snapshot origin device ?
  2016-07-14 14:25 write directly to device mapper snapshot origin device ? Navin P.S
@ 2016-07-15  8:29 ` Navin P.S
  2016-07-15 11:51   ` Mikulas Patocka
  0 siblings, 1 reply; 9+ messages in thread
From: Navin P.S @ 2016-07-15  8:29 UTC (permalink / raw)
  To: dm-devel, snitzer, mpatocka

Resend ..

On Thu, Jul 14, 2016 at 7:55 PM, Navin P.S <navinp1912@gmail.com> wrote:
> Hi,
>   Can i do dd if=/dev/zero of=/dev/mapper/dmo count=20 ? where dmo is
> a dm snapshot origin created through dmsetup command. Instead of
> /dev/zero i can write valid devices.
>
> I could create the dmo through some lvm2 commands. Is direct write
> with 4k (page size values ) allowed when it is mapped to 2 block
> devices in linear mode ?
>
>
> Regards,
> -- Navin

I'm seeing  OOM followed by reboot of host machine.
Does this mean this device cannot to exported to containers for writing ?


-- 
-- Navin

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

* Re: write directly to device mapper snapshot origin device ?
  2016-07-15  8:29 ` Navin P.S
@ 2016-07-15 11:51   ` Mikulas Patocka
  2016-07-15 12:15     ` Navin P.S
  0 siblings, 1 reply; 9+ messages in thread
From: Mikulas Patocka @ 2016-07-15 11:51 UTC (permalink / raw)
  To: Navin P.S; +Cc: dm-devel, snitzer



On Fri, 15 Jul 2016, Navin P.S wrote:

> Resend ..
> 
> On Thu, Jul 14, 2016 at 7:55 PM, Navin P.S <navinp1912@gmail.com> wrote:
> > Hi,
> >   Can i do dd if=/dev/zero of=/dev/mapper/dmo count=20 ? where dmo is
> > a dm snapshot origin created through dmsetup command. Instead of
> > /dev/zero i can write valid devices.
> >
> > I could create the dmo through some lvm2 commands.

lvcreate -s

> > Is direct write
> > with 4k (page size values ) allowed when it is mapped to 2 block
> > devices in linear mode ?
> >
> >
> > Regards,
> > -- Navin
> 
> I'm seeing  OOM followed by reboot of host machine.
> Does this mean this device cannot to exported to containers for writing ?

The snapshot driver requires 32 bytes of memory for one chunk (the chunk 
size is selected with the "-c" switch to lvcreate). You should set system 
memory according to that.

Mikulas

> -- Navin
> 

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

* Re: write directly to device mapper snapshot origin device ?
  2016-07-15 11:51   ` Mikulas Patocka
@ 2016-07-15 12:15     ` Navin P.S
  2016-07-15 12:35       ` Zdenek Kabelac
  2016-07-15 13:50       ` Mikulas Patocka
  0 siblings, 2 replies; 9+ messages in thread
From: Navin P.S @ 2016-07-15 12:15 UTC (permalink / raw)
  To: Mikulas Patocka; +Cc: dm-devel, snitzer

On Fri, Jul 15, 2016 at 5:21 PM, Mikulas Patocka <mpatocka@redhat.com> wrote:
>
>
> On Fri, 15 Jul 2016, Navin P.S wrote:
>
>> Resend ..
>>
>> On Thu, Jul 14, 2016 at 7:55 PM, Navin P.S <navinp1912@gmail.com> wrote:
>> > Hi,
>> >   Can i do dd if=/dev/zero of=/dev/mapper/dmo count=20 ? where dmo is
>> > a dm snapshot origin created through dmsetup command. Instead of
>> > /dev/zero i can write valid devices.
>> >
>> > I could create the dmo through some lvm2 commands.
>
> lvcreate -s
>
>> > Is direct write
>> > with 4k (page size values ) allowed when it is mapped to 2 block
>> > devices in linear mode ?
>> >
>> >
>> > Regards,
>> > -- Navin
>>
>> I'm seeing  OOM followed by reboot of host machine.
>> Does this mean this device cannot to exported to containers for writing ?
>
> The snapshot driver requires 32 bytes of memory for one chunk (the chunk
> size is selected with the "-c" switch to lvcreate). You should set system
> memory according to that.
>
> Mikulas
>
>> -- Navin
>>




Are origin devices readonly ?

When i do dd if=/dev/zero of=/dev/mapper/ff count=10, it kills all the
process says OOM.

How do you go about debugging this ? I'm running 4.7.0-rc7+ .


root@vm-xenial-foo:~# dmsetup info
Name:              cryptie4-ff
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      0
Major, minor:      251, 0
Number of targets: 2

Name:              ff
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      0
Major, minor:      251, 1
Number of targets: 1

root@vm-xenial-foo:~# dmsetup status
cryptie4-ff: 0 102400 linear
cryptie4-ff: 102400 122880 linear
ff: 0 102400 snapshot-origin
root@vm-xenial-foo:~#




free -m
              total        used        free      shared  buff/cache   available
Mem:           7762        2178        3720         358        1864        4920
Swap:         19145           0       19145


-- 
-- Navin

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

* Re: write directly to device mapper snapshot origin device ?
  2016-07-15 12:15     ` Navin P.S
@ 2016-07-15 12:35       ` Zdenek Kabelac
  2016-07-15 12:40         ` Navin P.S
  2016-07-15 13:50       ` Mikulas Patocka
  1 sibling, 1 reply; 9+ messages in thread
From: Zdenek Kabelac @ 2016-07-15 12:35 UTC (permalink / raw)
  To: Navin P.S; +Cc: dm-devel

Dne 15.7.2016 v 14:15 Navin P.S napsal(a):
> On Fri, Jul 15, 2016 at 5:21 PM, Mikulas Patocka <mpatocka@redhat.com> wrote:
>>
>>
>> On Fri, 15 Jul 2016, Navin P.S wrote:
>>
>>> Resend ..
>>>
>>> On Thu, Jul 14, 2016 at 7:55 PM, Navin P.S <navinp1912@gmail.com> wrote:
>>>> Hi,
>>>>   Can i do dd if=/dev/zero of=/dev/mapper/dmo count=20 ? where dmo is
>>>> a dm snapshot origin created through dmsetup command. Instead of
>>>> /dev/zero i can write valid devices.
>>>>
>>>> I could create the dmo through some lvm2 commands.
>>
>> lvcreate -s
>>
>>>> Is direct write
>>>> with 4k (page size values ) allowed when it is mapped to 2 block
>>>> devices in linear mode ?
>>>>
>>>>
>>>> Regards,
>>>> -- Navin
>>>
>>> I'm seeing  OOM followed by reboot of host machine.
>>> Does this mean this device cannot to exported to containers for writing ?
>>
>> The snapshot driver requires 32 bytes of memory for one chunk (the chunk
>> size is selected with the "-c" switch to lvcreate). You should set system
>> memory according to that.
>>
>> Mikulas
>>
>>> -- Navin
>>>
>
>
>
>
> Are origin devices readonly ?
>
> When i do dd if=/dev/zero of=/dev/mapper/ff count=10, it kills all the
> process says OOM.
>
> How do you go about debugging this ? I'm running 4.7.0-rc7+ .
>
>
> root@vm-xenial-foo:~# dmsetup info
> Name:              cryptie4-ff
> State:             ACTIVE
> Read Ahead:        256
> Tables present:    LIVE
> Open count:        0
> Event number:      0
> Major, minor:      251, 0
> Number of targets: 2
>
> Name:              ff
> State:             ACTIVE
> Read Ahead:        256
> Tables present:    LIVE
> Open count:        0
> Event number:      0
> Major, minor:      251, 1
> Number of targets: 1
>
> root@vm-xenial-foo:~# dmsetup status
> cryptie4-ff: 0 102400 linear
> cryptie4-ff: 102400 122880 linear
> ff: 0 102400 snapshot-origin
> root@vm-xenial-foo:~#

Hi

Maybe you should have started with reading documenation for snapshot target ?

linux/Documentation/device-mapper/snapshot.txt

If you don't like to read much doc - I'd highly recommend to stay at 'lvm2' 
command level and create snapshot via  'lvcreate -s'

Regards

Zdenek

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

* Re: write directly to device mapper snapshot origin device ?
  2016-07-15 12:35       ` Zdenek Kabelac
@ 2016-07-15 12:40         ` Navin P.S
  2016-07-15 12:44           ` Zdenek Kabelac
  0 siblings, 1 reply; 9+ messages in thread
From: Navin P.S @ 2016-07-15 12:40 UTC (permalink / raw)
  To: Zdenek Kabelac; +Cc: dm-devel

On Fri, Jul 15, 2016 at 6:05 PM, Zdenek Kabelac <zkabelac@redhat.com> wrote:
> Dne 15.7.2016 v 14:15 Navin P.S napsal(a):
>
>> On Fri, Jul 15, 2016 at 5:21 PM, Mikulas Patocka <mpatocka@redhat.com>
>> wrote:
>>>
>>>
>>>
>>> On Fri, 15 Jul 2016, Navin P.S wrote:
>>>
>>>> Resend ..
>>>>
>>>> On Thu, Jul 14, 2016 at 7:55 PM, Navin P.S <navinp1912@gmail.com> wrote:
>>>>>
>>>>> Hi,
>>>>>   Can i do dd if=/dev/zero of=/dev/mapper/dmo count=20 ? where dmo is
>>>>> a dm snapshot origin created through dmsetup command. Instead of
>>>>> /dev/zero i can write valid devices.
>>>>>
>>>>> I could create the dmo through some lvm2 commands.
>>>
>>>
>>> lvcreate -s
>>>
>>>>> Is direct write
>>>>> with 4k (page size values ) allowed when it is mapped to 2 block
>>>>> devices in linear mode ?
>>>>>
>>>>>
>>>>> Regards,
>>>>> -- Navin
>>>>
>>>>
>>>> I'm seeing  OOM followed by reboot of host machine.
>>>> Does this mean this device cannot to exported to containers for writing
>>>> ?
>>>
>>>
>>> The snapshot driver requires 32 bytes of memory for one chunk (the chunk
>>> size is selected with the "-c" switch to lvcreate). You should set system
>>> memory according to that.
>>>
>>> Mikulas
>>>
>>>> -- Navin
>>>>
>>
>>
>>
>>
>> Are origin devices readonly ?
>>
>> When i do dd if=/dev/zero of=/dev/mapper/ff count=10, it kills all the
>> process says OOM.
>>
>> How do you go about debugging this ? I'm running 4.7.0-rc7+ .
>>
>>
>> root@vm-xenial-foo:~# dmsetup info
>> Name:              cryptie4-ff
>> State:             ACTIVE
>> Read Ahead:        256
>> Tables present:    LIVE
>> Open count:        0
>> Event number:      0
>> Major, minor:      251, 0
>> Number of targets: 2
>>
>> Name:              ff
>> State:             ACTIVE
>> Read Ahead:        256
>> Tables present:    LIVE
>> Open count:        0
>> Event number:      0
>> Major, minor:      251, 1
>> Number of targets: 1
>>
>> root@vm-xenial-foo:~# dmsetup status
>> cryptie4-ff: 0 102400 linear
>> cryptie4-ff: 102400 122880 linear
>> ff: 0 102400 snapshot-origin
>> root@vm-xenial-foo:~#
>
>
> Hi
>
> Maybe you should have started with reading documenation for snapshot target
> ?
>
> linux/Documentation/device-mapper/snapshot.txt
>

It nowhere mentions that origin device is readonly. It says writes go
to COW device
and then you can merge it back.

Can you please paste the snippet ?

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

* Re: write directly to device mapper snapshot origin device ?
  2016-07-15 12:40         ` Navin P.S
@ 2016-07-15 12:44           ` Zdenek Kabelac
  2016-07-15 18:58             ` Navin P.S
  0 siblings, 1 reply; 9+ messages in thread
From: Zdenek Kabelac @ 2016-07-15 12:44 UTC (permalink / raw)
  To: Navin P.S; +Cc: dm-devel

Dne 15.7.2016 v 14:40 Navin P.S napsal(a):
> On Fri, Jul 15, 2016 at 6:05 PM, Zdenek Kabelac <zkabelac@redhat.com> wrote:
>> Dne 15.7.2016 v 14:15 Navin P.S napsal(a):
>>
>>> On Fri, Jul 15, 2016 at 5:21 PM, Mikulas Patocka <mpatocka@redhat.com>
>>> wrote:
>>>>
>>>>
>>>>
>>>> On Fri, 15 Jul 2016, Navin P.S wrote:
>>>>
>>>>> Resend ..
>>>>>
>>>>> On Thu, Jul 14, 2016 at 7:55 PM, Navin P.S <navinp1912@gmail.com> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>   Can i do dd if=/dev/zero of=/dev/mapper/dmo count=20 ? where dmo is
>>>>>> a dm snapshot origin created through dmsetup command. Instead of
>>>>>> /dev/zero i can write valid devices.
>>>>>>
>>>>>> I could create the dmo through some lvm2 commands.
>>>>
>>>>
>>>> lvcreate -s
>>>>
>>>>>> Is direct write
>>>>>> with 4k (page size values ) allowed when it is mapped to 2 block
>>>>>> devices in linear mode ?
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>> -- Navin
>>>>>
>>>>>
>>>>> I'm seeing  OOM followed by reboot of host machine.
>>>>> Does this mean this device cannot to exported to containers for writing
>>>>> ?
>>>>
>>>>
>>>> The snapshot driver requires 32 bytes of memory for one chunk (the chunk
>>>> size is selected with the "-c" switch to lvcreate). You should set system
>>>> memory according to that.
>>>>
>>>> Mikulas
>>>>
>>>>> -- Navin
>>>>>
>>>
>>>
>>>
>>>
>>> Are origin devices readonly ?
>>>
>>> When i do dd if=/dev/zero of=/dev/mapper/ff count=10, it kills all the
>>> process says OOM.
>>>
>>> How do you go about debugging this ? I'm running 4.7.0-rc7+ .
>>>
>>>
>>> root@vm-xenial-foo:~# dmsetup info
>>> Name:              cryptie4-ff
>>> State:             ACTIVE
>>> Read Ahead:        256
>>> Tables present:    LIVE
>>> Open count:        0
>>> Event number:      0
>>> Major, minor:      251, 0
>>> Number of targets: 2
>>>
>>> Name:              ff
>>> State:             ACTIVE
>>> Read Ahead:        256
>>> Tables present:    LIVE
>>> Open count:        0
>>> Event number:      0
>>> Major, minor:      251, 1
>>> Number of targets: 1
>>>
>>> root@vm-xenial-foo:~# dmsetup status
>>> cryptie4-ff: 0 102400 linear
>>> cryptie4-ff: 102400 122880 linear
>>> ff: 0 102400 snapshot-origin
>>> root@vm-xenial-foo:~#
>>
>>
>> Hi
>>
>> Maybe you should have started with reading documenation for snapshot target
>> ?
>>
>> linux/Documentation/device-mapper/snapshot.txt
>>
>
> It nowhere mentions that origin device is readonly. It says writes go
> to COW device
> and then you can merge it back.
>
> Can you please paste the snippet ?


1) a device containing the original mapping table of the source volume;
2) a device used as the <COW device>;
3) a "snapshot" device, combining #1 and #2, which is the visible snapshot
    volume;
4) the "original" volume (which uses the device number used by the original
    source volume), whose table is replaced by a "snapshot-origin" mapping
    from device #1.

Regards

Zdenek

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

* Re: write directly to device mapper snapshot origin device ?
  2016-07-15 12:15     ` Navin P.S
  2016-07-15 12:35       ` Zdenek Kabelac
@ 2016-07-15 13:50       ` Mikulas Patocka
  1 sibling, 0 replies; 9+ messages in thread
From: Mikulas Patocka @ 2016-07-15 13:50 UTC (permalink / raw)
  To: Navin P.S; +Cc: dm-devel, snitzer

> Are origin devices readonly ?
> 
> When i do dd if=/dev/zero of=/dev/mapper/ff count=10, it kills all the
> process says OOM.
> 
> How do you go about debugging this ? I'm running 4.7.0-rc7+ .

Find some older kernel where this worked.

Use the git bisect tool on the kernel tree to find out which patch broke 
it.

Mikulas

> root@vm-xenial-foo:~# dmsetup info
> Name:              cryptie4-ff
> State:             ACTIVE
> Read Ahead:        256
> Tables present:    LIVE
> Open count:        0
> Event number:      0
> Major, minor:      251, 0
> Number of targets: 2
> 
> Name:              ff
> State:             ACTIVE
> Read Ahead:        256
> Tables present:    LIVE
> Open count:        0
> Event number:      0
> Major, minor:      251, 1
> Number of targets: 1
> 
> root@vm-xenial-foo:~# dmsetup status
> cryptie4-ff: 0 102400 linear
> cryptie4-ff: 102400 122880 linear
> ff: 0 102400 snapshot-origin
> root@vm-xenial-foo:~#
> 
> 
> 
> 
> free -m
>               total        used        free      shared  buff/cache   available
> Mem:           7762        2178        3720         358        1864        4920
> Swap:         19145           0       19145
> 
> 
> -- 
> -- Navin
> 

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

* Re: write directly to device mapper snapshot origin device ?
  2016-07-15 12:44           ` Zdenek Kabelac
@ 2016-07-15 18:58             ` Navin P.S
  0 siblings, 0 replies; 9+ messages in thread
From: Navin P.S @ 2016-07-15 18:58 UTC (permalink / raw)
  To: Zdenek Kabelac; +Cc: dm-devel

On Fri, Jul 15, 2016 at 6:14 PM, Zdenek Kabelac <zkabelac@redhat.com> wrote:
> Dne 15.7.2016 v 14:40 Navin P.S napsal(a):
>
>> On Fri, Jul 15, 2016 at 6:05 PM, Zdenek Kabelac <zkabelac@redhat.com>
>> wrote:
>>>
>>> Dne 15.7.2016 v 14:15 Navin P.S napsal(a):
>>>
>>>> On Fri, Jul 15, 2016 at 5:21 PM, Mikulas Patocka <mpatocka@redhat.com>
>>>> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Fri, 15 Jul 2016, Navin P.S wrote:
>>>>>
>>>>>> Resend ..
>>>>>>
>>>>>> On Thu, Jul 14, 2016 at 7:55 PM, Navin P.S <navinp1912@gmail.com>
>>>>>> wrote:
>>>>>>>
>>>>>>>
>>>>>>> Hi,
>>>>>>>   Can i do dd if=/dev/zero of=/dev/mapper/dmo count=20 ? where dmo is
>>>>>>> a dm snapshot origin created through dmsetup command. Instead of
>>>>>>> /dev/zero i can write valid devices.
>>>>>>>
>>>>>>> I could create the dmo through some lvm2 commands.
>>>>>
>>>>>
>>>>>
>>>>> lvcreate -s
>>>>>
>>>>>>> Is direct write
>>>>>>> with 4k (page size values ) allowed when it is mapped to 2 block
>>>>>>> devices in linear mode ?
>>>>>>>
>>>>>>>
>>>>>>> Regards,
>>>>>>> -- Navin
>>>>>>
>>>>>>
>>>>>>
>>>>>> I'm seeing  OOM followed by reboot of host machine.
>>>>>> Does this mean this device cannot to exported to containers for
>>>>>> writing
>>>>>> ?
>>>>>
>>>>>
>>>>>
>>>>> The snapshot driver requires 32 bytes of memory for one chunk (the
>>>>> chunk
>>>>> size is selected with the "-c" switch to lvcreate). You should set
>>>>> system
>>>>> memory according to that.
>>>>>
>>>>> Mikulas
>>>>>
>>>>>> -- Navin
>>>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Are origin devices readonly ?
>>>>
>>>> When i do dd if=/dev/zero of=/dev/mapper/ff count=10, it kills all the
>>>> process says OOM.
>>>>
>
>>
>> Can you please paste the snippet ?
>
>
>
> 1) a device containing the original mapping table of the source volume;
> 2) a device used as the <COW device>;
> 3) a "snapshot" device, combining #1 and #2, which is the visible snapshot
>    volume;
> 4) the "original" volume (which uses the device number used by the original
>    source volume), whose table is replaced by a "snapshot-origin" mapping
>    from device #1.
>

1,2,3,4 doesn't say you can't write to snapshot-origin ? Does it ?
If you setup the table with dmsetup -r explicitly it means readonly.

Also if direct writes are not supposed to be done, only merging why
not setup readonly and
then create it in read-write during merging.


-- 
-- Navin

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

end of thread, other threads:[~2016-07-15 18:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14 14:25 write directly to device mapper snapshot origin device ? Navin P.S
2016-07-15  8:29 ` Navin P.S
2016-07-15 11:51   ` Mikulas Patocka
2016-07-15 12:15     ` Navin P.S
2016-07-15 12:35       ` Zdenek Kabelac
2016-07-15 12:40         ` Navin P.S
2016-07-15 12:44           ` Zdenek Kabelac
2016-07-15 18:58             ` Navin P.S
2016-07-15 13:50       ` Mikulas Patocka

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.