public inbox for linux-bcache@vger.kernel.org
 help / color / mirror / Atom feed
* bcache on NBD block devices
@ 2014-02-25 14:40 Juan Antonio Martinez
  2014-02-25 16:33 ` Paul Clements
  0 siblings, 1 reply; 4+ messages in thread
From: Juan Antonio Martinez @ 2014-02-25 14:40 UTC (permalink / raw)
  To: linux-bcache-u79uwXL29TY76Z2rM5mHXA
  Cc: nbd-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi all

(This is my first post on this list. I'm still a novice on bcache and
proper nettiquete on this list, so apologize for my mistakes)

Scenario: several NBD LTSP Fat Clients on (a bit) obsolete hardware
kernel 3.11.0-15 on Ubuntu 13.10

/dev/sda1 as local cache device
/dev/nbd1 as remote NBD backing bcache device

- I've created and registered /dev/sda1 as cache device without problems
- To create nbd file to be exported I've typed following sequence:

# create an empty file
root# dd if=/dev/zero of=bcache_test.img bs=1M count=64
# use it as loop block device
root# losetup /dev/loop0
# make it a backing bcache device
root# make-bcache -B /dev/loop0
# create a tiny fs on it
root# mksquashfs /usr/local /dev/bcache0 -noappend

Notice the squashfs: I only need to export fs in read-only mode

At this point I can mount file throught bcache w/o problems,
so unregister, de-loopize and copy raw bcache_test.img file to nbd
server host to be exported.

nbd-server is properly configure: I can list, connect and use file:

root# nbd-client server -N bcache_test /dev/nbd1 -persist -timeout 60 
Negotiation: ..size = 64MB
bs=1024, sz=67108864 bytes
timeout=60

Using bcache-super-show tells me that file is ok for bcache

root#  bcache-super-show /dev/nbd1
sb.magic		ok
sb.first_sector		8 [match]
sb.csum			AC160BF8DFFB808D [match]
sb.version		1 [backing device]

dev.label		(empty)
dev.uuid		936f8be4-7a90-4d2b-b118-5a45a1e37603
dev.sectors_per_block	1
dev.sectors_per_bucket	1024
dev.data.first_sector	16
dev.data.cache_mode	0 [writethrough]
dev.data.cache_state	1 [clean]

cset.uuid		479b0df0-56d3-4f31-951f-ffb69d8d233b

But.... At this point /dev/bcache0 is not created so cannot register it
manually with "echo <CSET-UUID> > /sys/block/bcache0/bcache/attach"

Item worse: NBD doesn't provide bcache directory under /sys/block/nbd1,
so can't execute "echo 1 > /sys/block/nbd1/bcache/running"

Notice that If I "dd" /dev/nbd1 to a local file and "losetup" on
it, /dev/bcache0 appears automagically attached to /dev/loop0

¿Any ideas?
¿Does NBD supports bcache in kernel 3.11?
¿If doesn't, any idea on the best way to provide local disk cache for
NBD remote devices?

Thanks in advance
Juan Antonio



------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Nbd-general mailing list
Nbd-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nbd-general

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [Nbd] bcache on NBD block devices
@ 2014-02-25 16:37 Paul Clements
       [not found] ` <CAECXXi68Q=5aXQ_NnubkMNsGxPPefCiz77pnYthNU-Jk88qQeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Clements @ 2014-02-25 16:37 UTC (permalink / raw)
  To: Juan Antonio Martinez; +Cc: linux-bcache

On Tue, Feb 25, 2014 at 9:40 AM, Juan Antonio Martinez
<jantonio@dit.upm.es> wrote:
>
> Hi all
>
> (This is my first post on this list. I'm still a novice on bcache and
> proper nettiquete on this list, so apologize for my mistakes)
>
> Scenario: several NBD LTSP Fat Clients on (a bit) obsolete hardware
> kernel 3.11.0-15 on Ubuntu 13.10
>
> /dev/sda1 as local cache device
> /dev/nbd1 as remote NBD backing bcache device
>
> - I've created and registered /dev/sda1 as cache device without problems
> - To create nbd file to be exported I've typed following sequence:
>
> # create an empty file
> root# dd if=/dev/zero of=bcache_test.img bs=1M count=64
> # use it as loop block device
> root# losetup /dev/loop0
> # make it a backing bcache device
> root# make-bcache -B /dev/loop0


have you tried doing this step from the client machine instead, i.e.:

make-bache -B /dev/nbd1

after the nbd connection is up? does that work?

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

end of thread, other threads:[~2014-02-26 10:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-25 14:40 bcache on NBD block devices Juan Antonio Martinez
2014-02-25 16:33 ` Paul Clements
  -- strict thread matches above, loose matches on Subject: below --
2014-02-25 16:37 [Nbd] " Paul Clements
     [not found] ` <CAECXXi68Q=5aXQ_NnubkMNsGxPPefCiz77pnYthNU-Jk88qQeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-26  8:31   ` Juan Antonio Martinez
2014-02-26 10:18     ` Juan Antonio Martinez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox