[ENBD] Number of remote devices

Peter T. Breuer ptb@it.uc3m.es
Mon, 16 Oct 2000 18:38:31 +0200 (CEST)


"A month of sundays ago Alexandru COSTIN wrote:"
>     Thanks again Peter, for the explanations
>     Anyway, analyzing the /dev/ndx nods shows that is possible to have (in
> the recommended mknod configuration) only 4 mounted devices (with
> partitions)

Each "whole" device (nda, ndb, ndc, etc.)
has to support a number of "partitions" (nda1, nda2, nda3, etc.) 
which are accessed by the individual client daemons, and the
different minors of all these serve to distinguish their
actions to the kernel.

The device has only one major number, so it has to divide up its
256 minors to provide the required spaces. In the default
compilation configuration, I believe it does this by providing
16 "whole" devices (this is the MAX_NBD parameter in the
code) with up to 15 "partitions" each (this is NBD_MAXCONN - 1).

So I think that 16 devices is the default limit, not 4.

>     It is possible to have 16 possible mounted devices? I am am very
> interested in having this kind of configuration

I believe this is the default configuration. You can also get up to 128
devices maximum, by changing the MAX_NBD and NBD_MAXCONN appropriately
(they must multiply to give 256, and at least 2 minors are needed per
device).

>     More specifically, I have 30 servers that have to mount maximum 16
> remote devices, each server can mount any device exported by the other
> servers (each server exports around 50 2GB files). Can anyone give me
> guidance of how can this be done ? Mknod script?

I think  you don't need to make any changes. The script to make the
devices can be like the one that exists, except counting to 16 instead
of 4. The existing MAKEDEV script in the distro just counts to 4. A
hack to the script is to extend the case statement (I got bored at ndd):

    case $dev in
      *a) minor=0 ;;
      *b) minor=16 ;;
      *c) minor=32 ;;
      *d) minor=48 ;;
      ...
      *p) minor=240 ;;
      *) minor=err-$dev ;;

and then call MAKEDEV /dev/nda /dev/ndb .... /dev/nbp

Peter