[Nbd] Can not open NBD error
Hi, every one.
I compiled a nbd-2.8.6 on my redhat 9 with kernel 2.4.20.
Because the absent of INSTALL file in the nbd-2.8.6.tar.gz , I use the normal way to install the nbd on both
client side and server side. These commands are :
[root]#./configure
[root]#make
[root]#make install
After do these, I use the following method to create server nbd service:
[root@...117... ramdisk]# ls -l /mnt/ramdisk/a
-rw-r--r-- 1 root root 63197184 4ÔÂ 15 23:38 /mnt/ramdisk/a
[root@...117... ramdisk]# nbd-server 2000 /mnt/ramdisk/a
[root@...117... ramdisk]# ps -aux | grep nbd-server
root 5775 0.0 0.1 1820 612 ? S Apr15 0:00 nbd-server 2000 /mnt/ramdisk/a
root 29534 0.0 0.1 4832 656 pts/0 S 16:15 0:00 grep nbd-server
Then in the client side,
[root@...118... sbin]# ls -l /dev/nb1
brw-rw---- 1 root disk 43, 1 2003-01-30 /dev/nb1
[root@...118... sbin]# nbd-client
192.168.0.15 2000 /dev/nb1
After done the above command, strange thing happened. There is nothing output. I do not know whether the client setup successfully. Then I do
[root@...118... sbin]# ps -aux | grep nbd-client
root 8842 0.0 0.1 4892 636 pts/0 S 02:13 0:00 grep nbd-client
I do not know why there are nothing output when the nbd-client not setup successfully.
Then i try this:
[root@...118... nbd-2.8.6]# gdb --args nbd-client
192.168.0.15 2000 /dev/nb1
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
When gdb stop at the 211 line, i use the step way, and found
(gdb) p nbddev
$2 = 0xbfa6f911 "/dev/nb1"
It's normal.
211 nbd = open(nbddev, O_RDWR);
When 211 was executed, nbd return error.
(gdb) p nbd
$4 = -1208637784
212 if (nbd < 0)
213 err("Can not open NBD: %m");
To find the reason why nothing print out, I step into the err function. And We found that the program run into the line where use a ifdef clause:
#ifdef ISSERVER
syslog(LOG_ERR, "%s", s1);
#else
Is there something going wrong?
we tail the log, we found that,
[root@...118... log]# tail messages
Apr 15 10:50:28 gt13 nbd_client[7307]: Can not open NBD: Illegal seek
Apr 15 10:51:06 gt13 nbd_client[7390]: Can not open NBD: Illegal seek
Apr 16 02:06:21 gt13 nbd_client[8819]: Can not open NBD: Illegal seek
Apr 16 02:06:33 gt13 nbd_client[8822]: Can not open NBD: Illegal seek
Apr 16 02:09:06 gt13 nbd_client[8825]: Can not open NBD: Illegal seek
Apr 16 02:10:17 gt13 nbd_client[8837]: Can not open NBD: Illegal seek
Apr 16 02:23:10 gt13 nbd_client[10975]: Can not open NBD: No such device or address
Apr 16 02:28:59 gt13 nbd_client[10993]: Can not open NBD: No such device or address
Apr 16 02:35:45 gt13 nbd_client[11025]: Can not open NBD: No such device or address
Apr 16 02:36:03 gt13 nbd_client[11029]: Can not open NBD: No such device or address
So what's going on?
Reply to: