[ENBD] Re: /dev/ndX devices and ... i don't understand!! :)

P.T. Breuer ptb at it.uc3m.es
Sat Apr 24 11:56:02 MDT 2004


In article <opr6ywhnuk5vdmd8 at zapata> you wrote:
> so this is my problem, i don't understand what does the MAJOR and MINOR
> number works.

It is your problem, but I doubt if anyone can help you with it! Major
and minors are just identifiers that allow the kernel to locate the
correct methods to use on the device.

> ok, explain , hope to find an answer ... sure about this :)
> 
> I'm setting up an LTSP environment with about 10 terminals.

Hic.

> i'm tryng to use ENBD for both floppy and CD on each Terminal so i
> thought well, i have 255 ENBD devices on my server with different minor
> number so i should have enough devices to deal with 10 terminals...

Well, depends how you compiled. Usually ENBD is compiled with 16 minors
per device, so that in 256 minors you can fit 16 devices.

> I've 2 set of devices , 1 set created by the MAKEDEV from the enbd site
> and 1 created from devfsd when the enbd module is loaded.
> 
> I've tried starting ENBD-CLIENT for CD on /dev/nda and the one for
> Floppy on /dev/nda4 .... but it doesn't works

It's not supposed to work. The sequence is nda ndb ndc ndd nde ..., 
not nda nda4 nda8 ...

> ... i always get a message
> like "device yet used" ...

Because it is - nda4 is a minor of nda, and nda is used. I'm glad the
code spotted that :-).

> The only way to make it works is to use e different /dev/ndX for each

Sure.

> local device on the terminal ... is this right or am i missing something?

You're missing nothing.

> if i cat /proc/nbdinfo i see that the device are divided on a ndX (with
> the letter X) base ...
> 
> i need at least 20 different nbd device to use for my 10 Terminals ,
> what can i do?

Count to 20.  Unfortunately at 16 devices you will run out of the 256
minors available for major 43, so you will never get to 20!

So:

   1) either  recompile enbd with 8 or 4 minors per device, instead of 16

   or

   2) use a different major for the last 4 devices, which you can do by
      loading the module a second time with "major=whatever". And set
      up some more entries in /dev/ to match.

1) is generally the approach taken by people. In enbd.h change

     #define ENBD_SHIFT 4         /* PTB 16 partitions/sockets/slots per device */ 

to 3 for 8 minors per device, or 2 for 4 minors per device.

Ho hum - and then you have a real fine time renumbering /dev/ ahead of you!
Fortunately, the MAKEDEV script that comes with enbd seems adjustable:

   major=43
   MAXCON=16

change MAXCON to 8, or 4, as appropriate.


Anyone seriously want me to make this dynamic?

Peter


More information about the ENBD mailing list