[ENBD] kernel message "non existant block device"
Peter T. Breuer
ptb@it.uc3m.es
Tue, 24 Oct 2000 00:57:51 +0200 (MET DST)
"A month of sundays ago pbmonday@imation.com wrote:"
>
>
> "A month of sundays ago pbmonday@imation.com wrote:"
> >That's not possible if the device you are accessing is open and functioning,
> >so it isn't. You must be accessing the wrong device.
>
> I've tried multiple different routes to the device. I'm accessing the
> device properly as far as I can tell.
A device is something like "/dev/hda1". In this case it will be
"/dev/nda". It sould have major 43 and minor 0. There's nothing to
"tell" and there are no "routes" to it. You either are accessing
/dev/nda or you aren't, it's a fact (shrug).
In this case it is certain that you aren't. The device says so. The
kernel says so. I'm sure of it. Do:
ls -l /dev/nda
(to prove that it 43,0)
cat /proc/devices
(to show that nbd has 43)
dmesg | tail
(to prove that it is the right nbd that you have loaded)
dd if=/dev/zero of=/dev/nda bs=1024 count=5
dmesg | tail
(to prove that there are kernel errors)
> >> [a] State: initialized, verify, rw, enabled, last error 0
> >All good. /dev/nda is open.
>
> >And you haven't accessed it. A betting man would say that you're
> >writing to the wrong device file. What was the command line you used to
> >elicit the errors? (plus errors, please).
>
> A betting man would say that, but I think they'd lose the bet. I'm trying
> two different commands:
> dd if=/dev/zero of=/dev/nda bs=1024 count=5
> Both end up failing and writing to supposed block devices that don't exist.
Then they don't exist. That is a fact.
> Odd, though this shouldn't have any effect, I did notice that there are
> other devices installed by SuSE with major 43 and minors 0-15 (ttyIx).
Oh, I see, No, those are special files for character devices, not
block devices.
What is your kernel? Surely 2.2.16 or thereabouts?
I have suse 7.0 and 6.3 somewhere. Let me see ...
brw-rw---- 1 root 43, 0 Jul 23 1999 nb0
brw-rw---- 1 root 43, 1 Jul 23 1999 nb1
brw-rw---- 1 root 43, 10 Jul 23 1999 nb10
brw-rw---- 1 root 43, 11 Jul 23 1999 nb11
brw-rw---- 1 root 43, 12 Jul 23 1999 nb12
brw-rw---- 1 root 43, 13 Jul 23 1999 nb13
brw-rw---- 1 root 43, 14 Jul 23 1999 nb14
brw-rw---- 1 root 43, 15 Jul 23 1999 nb15
brw-rw---- 1 root 43, 2 Jul 23 1999 nb2
so SuSE has some special files ready made. More or less makes no
difference.
> There is no entry for handling major 43 in the /proc/devices until I
> install the nbd module.
Then nbd has (block) major 43. That's certain. So any write
to a block special file with major 43 will go to nbd.
> This is the catch that's killing me. It does not appear that I actually
> get to the device, anywhere. Could the other devices with major 43 be
> confusing the nbd module?
There is only one block device with major 43 in the kernel at a time (by
definition). You are confusing special files with the devices they may
represent, I think, but it doesn't matter. So what does ls -l /dev/nda
show you? It should be:
brw-r--r-- 1 root root 43, 0 Jul 27 1999 /dev/nda
and then it is inevitable that writing to that file causes requests
from the kernel to appear and be passed to the nbd driver, if it is
loaded. Being loaded means it shows up in /proc/modules and
/proc/devices
Block devices:
1 ramdisk
3 ide0
9 md
43 nbd
and that /proc/nbdinfo is fully populated. That output comes from the
kernel driver and shows its state. You know the driver is working if you
can read from /proc/nbdinfo.
If you want further evidence, recompile everything with "make clean;
make DEBUG=1". Every single function entrance and exit will be logged.
(you may wish to only compile the kernel module with -DDEBUG=1, to
cut down on chatter, as the daemons are known to function). Higher
debug values give even more output.
Peter