You are not logged in.
Pages: 1
Topic closed
hi,
I'm kind of stuck with the nbd config file, it just doesn't work correctly. It currently looks like this:
$ cat /etc/nbd-server/config
[generic]
[nbdexport]
exportname = /nbdfile
port = 1234
starting nbd via /etc/rc.d/nbd works fine, however, the expected export is not running. Instead I get:
$ netstat -tulpen
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 0.0.0.0:10809 0.0.0.0:* LISTEN 0 8746628 29192/nbd-server
As you can see, nbd is running on port 10809 instead of 1234 and connecting doesn't work either:
$ nbd-client localhost 10809 /dev/nbd0
Negotiation: .Error: Not enough cliserv_magic
Exiting.
If I start nbd-server manually, everything works as expected.
nbd-server -C " " 1234 /nbdfile
I add a non-existent config file (-C) because otherwise nbd parses the config file as well.
What am I missing here? Is this a bug? I tried a lot of different options in the config but it simply never works as expected.
Offline
I think if you are using nbd 2.9.17 or later, the port number becomes relevant only if "oldstyle" to set to true. Refer to "man 5 nbd-server" for more info.
[generic]
oldstyle = true <--
[nbdexport]
exportname = /nbdfile
port = 1234
__
sol
Offline
Okay, I just figured it out. If you use the "newstyle", then:
in /etc/nbd-server/config you would have sections like "export1", "export2" etc:
[generic]
...
[export1]
exportname = /dev/disk/by-uuid/xxxxxxxxx
To mount "export1", you do this:
nbd-client <IP_ADDR> /dev/nbd0 -N export1
Offline
Does anybody figure out how to specify the port?
I have a weird behavior with `nbd-server` (3.10). If I specify the port, it still listens to a bunch of other ports. Only listening to the default port work for some reason.
~ sudo nbd-server localhost:9000 /dev/sdc
** (process:3121): WARNING **: Specifying an export on the command line is deprecated.
** (process:3121): WARNING **: Please use a configuration file instead.
Below you can see that it listens to a bunch of other ports, including the default one.
~ sudo netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:55055 0.0.0.0:* LISTEN 3122/nbd-server
tcp 0 0 0.0.0.0:10809 0.0.0.0:* LISTEN 3122/nbd-server
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 3122/nbd-server
tcp6 0 0 :::51489 :::* LISTEN 3122/nbd-server
tcp6 0 0 ::1:9000 :::* LISTEN 3122/nbd-server
My config file is simple:
[generic]
user = nbd
group = nbd
[otherexport]
exportname = /dev/sdc
#port = 9000
Of course, it prints a warning that specifying an export on the command line is deprecated. But without `/dev/sdc` argument it will ignore the port completely and listen to the default port.
~ sudo nbd-server localhost:9000
~ sudo netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:10809 0.0.0.0:* LISTEN 3171/nbd-server
Running it without any arguments does work. It starts without warnings and it listens to only one port, as you can see below. Unfortunately that's not the port I want it to listen to:
~ sudo nbd-server
~ sudo netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:10809 0.0.0.0:* LISTEN 3222/nbd-server
Switching to oldstyle protocol does not work:
~ sudo nbd-server
** Message: Since 3.10, the oldstyle protocol is no longer supported. Please migrate to the newstyle protocol.
** Message: Exiting.
the config for the command above ^ was
[generic]
oldstyle=true
user = nbd
group = nbd
[otherexport]
exportname = /dev/sdc
port = 9000
Offline
Please open a new topic about your problem, this topic is ancient.
https://wiki.archlinux.org/index.php/Fo … bumping.22
Closing.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1
Topic closed