View Single Post
Old 10-23-2012, 11:20 AM   #60
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021146
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
Originally Posted by knc1 View Post
No, it would not be "too slow", but it might be noticeable.

If the kernel supports NBD (Network Block Device), swap works over NBD.

It does not work over CIFS (Samba) nor NFS. In both cases trying to do that can lead to a kernel deadlock.
okay. I've built a few tools to give this a try. Don't want to Hi-jack the thread though so I've spoilered most of it...

Spoiler:
[root@kindle root]# nbd-server --help
Quote:
This is nbd-server version 3.1
Usage: [ip:|ip6@]port file_to_export [size][kKmM] [-l authorize_file] [-r] [-m] [-c] [-C configuration file] [-p PID file name] [-o section name] [-M max connections]
-r|--read-only read only
-m|--multi-file multiple file
-c|--copy-on-write copy on write
-C|--config-file specify an alternate configuration file
-l|--authorize-file file with list of hosts that are allowed to
connect.
-p|--pid-file specify a filename to write our PID to
-o|--output-config output a config file section for what you
specified on the command line, with the
specified section name
-M|--max-connections specify the maximum number of opened connections

if port is set to 0, stdin is used (for running from inetd).
if file_to_export contains '%s', it is substituted with the IP
address of the machine trying to connect
if ip is set, it contains the local IP address on which we're listening.
if not, the server will listen on all local IP addresses
Using configuration file /etc/nbd-server/config
1st server test:

Kindle:

[root@kindle /dev]# nbd-server -C /dev/null 8080 /
Quote:
** (process:4268): WARNING **: Specifying an export on the command line is deprecated.

** (process:4268): WARNING **: Please use a configuration file instead.
(These warnings are expected)

PC:

me@dev ~/GIT/k5ctng $ sudo nbd-client kt 8080 /dev/nbd0
Quote:
Negotiation: ..size = 0MB
bs=1024, sz=8192 bytes
me@dev /dev $ sudo mount -a -o ro /dev/nbd0 /mnt/us
Quote:
mount: /dev/nbd0: can't read superblock
(now kill all processes related)
[root@kindle /dev]#killer nbd-server
(you can use pidof and kill instead)

2nd test:

Kindle:

[root@kindle /dev]# nbd-server -C /dev/null 8080 /mnt/us
Quote:
** (process:3918): WARNING **: Specifying an export on the command line is deprecated.

** (process:3918): WARNING **: Please use a configuration file instead.
PC:

me@dev /dev $ sudo nbd-client kt 8080 /dev/nbd0
Quote:
Negotiation: ..size = 0MB
bs=1024, sz=0 bytes
me@dev /dev $ sudo mount -t vfat -o ro /dev/nbd0 /mnt/us
Quote:
mount: /dev/nbd0: can't read superblock


so I obviously need to run more tests, do more reading as I am unsure of the expected output and the errors are quite unhelpful.

Can confirm there is no /dev/nbd0,1,2,3 in /dev on the touch... so it would probably be a custom kernel job to mount stuff with the client. but again I need to check that.

Have to read more about getting the swap space to run via nbd also. but essentially a nice quick set of tests that at least prove the arm bins run built via buildroot.

I used http://nbd.sourceforge.net/ http://www.thegeekstuff.com/2009/02/...mpstart-guide/ and http://www.microhowto.info/howto/exp...using_nbd.html as references.

Anyway, Hi-jack over. short answer: possibly.

: )

Last edited by twobob; 10-23-2012 at 11:25 AM. Reason: quote, clarity
twobob is offline   Reply With Quote