Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] How to setup nbd server config?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 651
Location: San Diego, CA

PostPosted: Mon Sep 26, 2011 10:07 pm    Post subject: [Solved] How to setup nbd server config? Reply with quote

I'm able to use nbd with the following commands.

server:
nbd-server 2000 /tmp/file -d

client:
nbd-client SERVER_IP 2000 /dev/nbd0


But whenever I start the server, I see the following warning message.
warning:
** (process:9104): WARNING **: Specifying an export on the command line is deprecated.
** (process:9104): WARNING **: Please use a configuration file instead.


So I created the config file.
/etc/nbd-server/config:
[generic]
[export]
   exportname = /tmp/file
   port = 2000


But when I do "nbd-server -d", the port 2000 is not open (at least not showing in "netstat -a"), and the client isn't able to connect. Please guide me what to look for. Thank you.
__
sol


Last edited by solamour on Tue Sep 27, 2011 10:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 651
Location: San Diego, CA

PostPosted: Tue Sep 27, 2011 5:34 pm    Post subject: Reply with quote

I just noticed that the configuration file described in the previous post (i.e. "/etc/nbd-server/config") works perfectly in Ubuntu 11.04, which has nbd 2.9.16-7.1ubuntu2, whereas Gentoo's latest is 2.9.22. I'm not sure the version difference is the cause of the problem, though.
__
sol
Back to top
View user's profile Send private message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 651
Location: San Diego, CA

PostPosted: Tue Sep 27, 2011 10:07 pm    Post subject: Reply with quote

It turned out that 2.9.17 or later requires "oldstyle" flag in order to be compatible with the older versions. Perhaps that's why Ubuntu sticks with 2.9.16 as of 11.04 release. When I added the required flag, everything worked as expected.

/etc/nbd-server/config:
[generic]
   oldstyle = true   <--
[export]
   exportname = /tmp/file
   port = 2000


If you want to use the "new" style in 2.9.17 or later, remove both "oldstyle" and "port". The default port 10809 will be used.
/etc/nbd-server/config:
[generic]
[export]
   exportname = /tmp/file


From the client side, you need to provide the name of export.

client:
nbd-client SERVER_IP /dev/nbd0 -name export


I must say that everything was clearly laid out in the manual page, but the examples there were somewhat misleading.
__
sol
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum