Re: About Dm-cache with NBD

209 views
Skip to first unread message

Ming Zhao

unread,
Sep 26, 2013, 11:54:39 AM9/26/13
to Tak Ho, Alex Li, dm-c...@googlegroups.com
Hi Alex,

What you described sounds reasonable. While the network is
disconnected, dm-cache can buffer all the writes as long as there is
enough space. Just use dm-cache in the write-back mode. But there
cannot be any read to the device before the network comes back.

When the network is recovered, you can send a signal to dm-cache to
flush all the buffered dirty data. The dmsetup message flush command
will do it.

Let me know if you have any other question.

Best,
- Ming

On Mon, Sep 23, 2013 at 5:54 AM, Tak Ho, Alex Li <ale...@bizconline.com> wrote:
> Dear Prof. Ming,
>
> we are developing a backup device (USB) with dm-cache and nbd. however, we'd
> stuck on the situation when network accidentally stopped, the NDB device
> will be hanged and gone. we need to reboot the USB such that it can resume.
>
> Our design is a backup device, once network disconnected, dm-cache can stage
> all change and once network resumed, dm-cache can write the files to the NDB
> device.
>
> Is our logic valid with dm-cache?
>
> Thanks a lot for your support.
>
> Best Rgds,
>
> Alex Li
>
> Mobile: (852) 9876 5443
> China Mobile: (86) 136 0028 0443
>
> BizCONLINE Limited
> Tel: 3483 2050
> HK Office: Room 511, Block B, Hoi Luen Industrial Center, 55 Hoi Yuen Road,
> Kwun Tong, Kowloon
> R&D Office: Unit 518, Level 5, Cyberport 3 (Core F), 100 Cyberport Road,
> Hong Kong
> Head Quarter: 中国佛山市南海区瀚天科技城8号15楼I205室
> Shanghai Office: 中国上海市杨浦区淞沪路234号创智天地科教广场1号楼204B室
>
> ============
> Cloud Backup with Continuity Assurance
>
>
> Matthew 5:37
>
> But let your words be simply, Yes or No: and whatever is more than these is
> of the Evil One.

Tak Ho, Alex Li

unread,
Sep 26, 2013, 12:14:00 PM9/26/13
to Ming Zhao, dm-c...@googlegroups.com, EncoreDeng

Dear prof,

Thanks a lot. We will try it out asap.

Thanks.

Alex Li Tak Ho
98765443

BizCONLINE Limited

EncoreDeng

unread,
Sep 27, 2013, 5:20:31 AM9/27/13
to Tak Ho, Alex Li, Ming Zhao, dm-c...@googlegroups.com

Dear prof,

 

         Thanks for your kind reply before, and I had tried below, and still have some problems.

 

1.       Setup the cache

[root@localhost dm-cache]# ./dmc-setup.pl -o /dev/nbd0 -c /dev/loop0 -n foo                         (command “echo 0 4194304 cache /dev/nbd0 /dev/loop0 0 8 65536 16 0 | dmsetup create foo”)

         Is OK.

 

2.       Remove the cache

[root@localhost dm-cache]# dmsetup remove foo

Is OK.

 

3.       Resetup the cache using persistence mode

[root@localhost dm-cache]# ./dmc-setup.pl -o /dev/nbd0 -c /dev/loop0 -n foo –p   (command “echo 0 4194304 cache /dev/nbd0 /dev/loop0 1 | dmsetup create foo”)

Fail with output “device-mapper: reload ioctl failed: Invalid argument”

 

I am using CentOS5.5, kernel version 2.6.18

And the dm-cache source I used is in “stable/2.6.19/”

 

May I ask if there some error steps I did or I need to try another version?

 

Thanks a lot for you support.

 

 

--

Best Rgds,

Encore Deng

Mobile: (86) 134 161 259 40

BizCONLine Limited 

Member company of Incu-Tech Programme, HKSTP

Tel: 3483 2050

Unit 222A, 2/F,Enterprise Place (Bldg 9),
No. 5 Science Park West Avenue,

Hong Kong Science Park, Shatin, N.T.

 

佛山公司地址:南海区瀚天科技城8号楼15I105

佛山公司电话:0757-86989295

 

============

 

Cloud Backup with Continuity Assurance

 

 

 

发件人: Tak Ho, Alex Li [mailto:ale...@bizconline.com]
发送时间: 2013927 0:14
收件人: Ming Zhao
抄送: dm-c...@googlegroups.com; EncoreDeng
主题: Re: About Dm-cache with NBD

EncoreDeng

unread,
Oct 1, 2013, 11:57:08 AM10/1/13
to Tak Ho, Alex Li, Ming Zhao, dm-c...@googlegroups.com

Dear Prof Ming,

 

         I have do the testing below,

 

1.       Setup a dm-cache device

“echo 0 4194304 cache /dev/nbd0 /dev/loop0 0 8 65536 16 1 | dmsetup create foo”

 

2.       Mount the device

“mount /dev/mapper/foo /mountpoint/foo”

 

3.       Delete the nbd

“nbd-client –d /dev/nbd0”

 

4.       Try copy a file in /mountpoint/foo

 

But the copy action is hung, I resumed the nbd connection but no use.

         As you said before, I can send a signal to dm-cache,

         I have try “dmsetup message /dev/mapper/foo 0 flush” but it printf error “device-mapper: message ioctl failed: Invalid argument”.

 

         Could you give some advice?

 

         Thanks.

 

 

 

 

--

Best Rgds,

Encore Deng

Mobile: (86) 134 161 259 40

BizCONLine Limited 

Member company of Incu-Tech Programme, HKSTP

Tel: 3483 2050

Unit 222A, 2/F,Enterprise Place (Bldg 9),
No. 5 Science Park West Avenue,

Hong Kong Science Park, Shatin, N.T.

 

佛山公司地址:南海区瀚天科技城8号楼15I105

佛山公司电话:0757-86989295

 

============

 

Cloud Backup with Continuity Assurance

 

 

 

发件人: EncoreDeng [mailto:encor...@cn.bizconline.com]
发送时间: 2013927 17:21
收件人: 'Tak Ho, Alex Li'; 'Ming Zhao'
抄送: 'dm-c...@googlegroups.com'
主题: 答复: About Dm-cache with NBD

 

Dear prof,

 

         Thanks for your kind reply before, and I had tried below, and still have some problems.

============

 

Cloud Backup with Continuity Assurance

 

 

 

发件人: Tak Ho, Alex Li [mailto:ale...@bizconline.com]

发送时间: 2013927 0:14
收件人: Ming Zhao
抄送: dm-c...@googlegroups.com; EncoreDeng
主题: Re: About Dm-cache with NBD

 

Dear prof,

Ming Zhao

unread,
Oct 1, 2013, 12:49:22 PM10/1/13
to dm-c...@googlegroups.com, Tak Ho, Alex Li
Hi Encore,

I will look into this. Which specific version of dm-cache are you using?

- Ming
> --
> You received this message because you are subscribed to the Google Groups
> "dm-cache" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dm-cache+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

EncoreDeng

unread,
Oct 4, 2013, 12:25:59 AM10/4/13
to Tak Ho, Alex Li, Ming Zhao, dm-c...@googlegroups.com

Dear Prof Ming,

 

         Thanks a lot for your reply.

         In fact, I have try 3 version of dm-cache :

         “dm-cache/testing/persistent-metadata” and “dm-cache/testing/shared-cache/2.6.32” in CentOS kernel version 2.6.32-358.14.1.el6.x86_64

         “dm-cache/stable/2.6.19” in CentOS kernel version 2.6.18

 

 

 

 

--

Best Rgds,

Encore Deng

Mobile: (86) 134 161 259 40

BizCONLine Limited 

Member company of Incu-Tech Programme, HKSTP

Tel: 3483 2050

Unit 222A, 2/F,Enterprise Place (Bldg 9),
No. 5 Science Park West Avenue,

Hong Kong Science Park, Shatin, N.T.

 

佛山公司地址:南海区瀚天科技城8号楼15I105

佛山公司电话:0757-86989295

 

============

 

Cloud Backup with Continuity Assurance

 

 

 

发件人: EncoreDeng [mailto:encor...@cn.bizconline.com]
发送时间: 2013101 23:57

收件人: 'Tak Ho, Alex Li'; 'Ming Zhao'
抄送: 'dm-c...@googlegroups.com'
主题: 答复: About Dm-cache with NBD

 

Dear Prof Ming,

============

 

Cloud Backup with Continuity Assurance

 

 

 

发件人: EncoreDeng [mailto:encor...@cn.bizconline.com]

============

 

Cloud Backup with Continuity Assurance

 

 

 

发件人: Tak Ho, Alex Li [mailto:ale...@bizconline.com]

发送时间: 2013927 0:14
收件人: Ming Zhao
抄送: dm-c...@googlegroups.com; EncoreDeng
主题: Re: About Dm-cache with NBD

 

Dear prof,

Tak Ho, Alex Li

unread,
Oct 4, 2013, 1:25:54 AM10/4/13
to EncoreDeng, Ming Zhao, dm-c...@googlegroups.com
Encore,

all the 3 versions have the same problem?

Best Rgds,
 
Alex Li
 
Mobile: (852) 9876 5443
China Mobile: (86) 136 0028 0443
 
BizCONLINE Limited
Tel: 3483 2050
HK Office: Room 511, Block B, Hoi Luen Industrial Center, 55 Hoi Yuen Road, Kwun Tong, Kowloon
R&D Office: Unit 518, Level 5, Cyberport 3 (Core F), 100 Cyberport Road, Hong Kong
Head Quarter: 中国佛山市南海区瀚天科技城8号15楼I205室
Shanghai Office: 中国上海市杨浦区淞沪路234号创智天地科教广场1号楼204B室
 
============
Cloud Backup with Continuity Assurance
 
 
Matthew 5:37  
 
But let your words be simply, Yes or No: and whatever is more than these is of the Evil One.


2013/10/4 EncoreDeng <encor...@cn.bizconline.com>

EncoreDeng

unread,
Oct 4, 2013, 1:51:06 AM10/4/13
to Tak Ho, Alex Li, Ming Zhao, dm-c...@googlegroups.com

Dear Dr,

 

         Yes.

 

 

 

--

Best Rgds,

Encore Deng

Mobile: (86) 134 161 259 40

BizCONLine Limited 

Member company of Incu-Tech Programme, HKSTP

Tel: 3483 2050

Unit 222A, 2/F,Enterprise Place (Bldg 9),
No. 5 Science Park West Avenue,

Hong Kong Science Park, Shatin, N.T.

 

佛山公司地址:南海区瀚天科技城8号楼15I105

佛山公司电话:0757-86989295

 

============

 

Cloud Backup with Continuity Assurance

 

 

 

发件人: Tak Ho, Alex Li [mailto:ale...@bizconline.com]

发送时间: 2013104 13:26
收件人: EncoreDeng
抄送: Ming Zhao; dm-c...@googlegroups.com
主题: Re: 答复: About Dm-cache with NBD

Ming Zhao

unread,
Oct 4, 2013, 7:49:56 AM10/4/13
to dm-c...@googlegroups.com, Tak Ho, Alex Li

Encore and Alex,

It seems you are using the dm-cache developed by redhat, not the one from VISA lab.

But I will try to have a student take a look of the redhat dm-cache. You can also try out our dm-cache.

- Ming

--

Tak Ho, Alex Li

unread,
Oct 8, 2013, 7:27:21 AM10/8/13
to Ming Zhao, EncoreDeng, dm-c...@googlegroups.com
Dear Encore,

Can you try the Dm-cache directly from Prof Zhao?

Thanks.

Best Rgds,
 
Alex Li
 
Mobile: (852) 9876 5443
China Mobile: (86) 136 0028 0443
 
BizCONLINE Limited
Tel: 3483 2050
HK Office: Room 511, Block B, Hoi Luen Industrial Center, 55 Hoi Yuen Road, Kwun Tong, Kowloon
R&D Office: Unit 518, Level 5, Cyberport 3 (Core F), 100 Cyberport Road, Hong Kong
Head Quarter: 中国佛山市南海区瀚天科技城8号15楼I205室
Shanghai Office: 中国上海市杨浦区淞沪路234号创智天地科教广场1号楼204B室
 
============
Cloud Backup with Continuity Assurance
 
 
Matthew 5:37  
 
But let your words be simply, Yes or No: and whatever is more than these is of the Evil One.


2013/10/4 Ming Zhao <mi...@cs.fiu.edu>

EncoreDeng

unread,
Oct 9, 2013, 2:35:19 AM10/9/13
to Tak Ho, Alex Li, Ming Zhao, dm-c...@googlegroups.com

Dear Prof Ming,

 

         Sorry, I don’t understand which one is developed by redhat.

         I download the source code from https://github.com/mingzhao/dm-cache

 

         And when I open the VISA lab as you said http://visa.cs.fiu.edu/tiki/dm-cache, I also see the source code link to GitHub.

 

         May I ask if I got a wrong source code?

 

         Thanks a lot for your kind help.

 

 

 

--

Best Rgds,

Encore Deng

Mobile: (86) 134 161 259 40

BizCONLine Limited 

Member company of Incu-Tech Programme, HKSTP

Tel: 3483 2050

Unit 222A, 2/F,Enterprise Place (Bldg 9),
No. 5 Science Park West Avenue,

Hong Kong Science Park, Shatin, N.T.

 

佛山公司地址:南海区瀚天科技城8号楼15I105

佛山公司电话:0757-86989295

 

============

 

Cloud Backup with Continuity Assurance

 

 

 

发件人: Tak Ho, Alex Li [mailto:ale...@bizconline.com]

发送时间: 2013108 19:27
收件人: Ming Zhao; EncoreDeng
抄送: dm-c...@googlegroups.com
主题: Re: [dmcache] 答复: 答复: About Dm-cache with NBD

Ming Zhao

unread,
Oct 9, 2013, 2:49:58 PM10/9/13
to dm-c...@googlegroups.com, Tak Ho, Alex Li
Encore,

One of my students will send you the exact patch with instructions shortly.

- Ming

Tak Ho, Alex Li

unread,
Oct 9, 2013, 3:41:44 PM10/9/13
to Ming Zhao, Encore Deng, dm-c...@googlegroups.com
thanks Prof Zhao.

Best Rgds,
 
Alex Li
 
Mobile: (852) 9876 5443
China Mobile: (86) 136 0028 0443
 
BizCONLINE Limited
Tel: 3483 2050
HK Office: Room 511, Block B, Hoi Luen Industrial Center, 55 Hoi Yuen Road, Kwun Tong, Kowloon
R&D Office: Unit 518, Level 5, Cyberport 3 (Core F), 100 Cyberport Road, Hong Kong
Head Quarter: 中国佛山市南海区瀚天科技城8号15楼I205室
Shanghai Office: 中国上海市杨浦区淞沪路234号创智天地科教广场1号楼204B室
 
============
Cloud Backup with Continuity Assurance
 
 
Matthew 5:37  
 
But let your words be simply, Yes or No: and whatever is more than these is of the Evil One.


2013/10/10 Ming Zhao <mi...@cs.fiu.edu>

Gregory Jean-baptise

unread,
Oct 9, 2013, 5:29:44 PM10/9/13
to dm-c...@googlegroups.com, Ming Zhao, Encore Deng
Hello all.

Attached is a modified version of the stable release of Dm-Cache. When there is dirty data in the cache that can be flushed back to the source, do the following:

dmsetup message [foo] 1 flush

message: This is the name of the function that allows messages to be sent to the module
foo: The name of your virtual cache. Replace with the actual name
1: The number of arguments. In this case, we are only sending one message
flush: Tells the module to flush all dirty blocks

Give it a try. If you run into any problems, please let me know.
Gregory Jean-Baptiste
Undergraduate Research Assistant @ V.I.S.A
Florida International University
dm-cache.c

ye4s...@sneakemail.com

unread,
Apr 7, 2014, 3:33:04 PM4/7/14
to dm-c...@googlegroups.com, Encore Deng
Hi Encore & Alex,

Did you get this working?  I want the exact same use case--dm-cache in write back mode in front of iSCSI.  Sometimes the iSCSI target will be available, sometimes not, and I want dm-cache to write out the dirty blocks only when the iSCSI target is available.

Thanks,
David

Gregory Jean-baptise

unread,
Apr 19, 2014, 4:58:11 PM4/19/14
to dm-c...@googlegroups.com, Encore Deng
I will work on this and send you an update as soon as possible.


For more options, visit https://groups.google.com/d/optout.



--
Gregory Jean-Baptiste
Graduate Research Assistant @ V.I.S.A
Florida International University
Reply all
Reply to author
Forward
0 new messages