public inbox for linux-bcache@vger.kernel.org
 help / color / mirror / Atom feed
From: Juan Antonio Martinez <jantonio-oytJ0Z/vEwre5aOfsHch1g@public.gmane.org>
To: linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: nbd-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: bcache on NBD block devices
Date: Tue, 25 Feb 2014 15:40:08 +0100	[thread overview]
Message-ID: <1393339208.26501.42.camel@jonsy> (raw)

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

             reply	other threads:[~2014-02-25 14:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25 14:40 Juan Antonio Martinez [this message]
2014-02-25 16:33 ` bcache on NBD block devices 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393339208.26501.42.camel@jonsy \
    --to=jantonio-oytj0z/vewre5aofshch1g@public.gmane.org \
    --cc=linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nbd-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox