[ILUG] Progress with nbd!

From: John Gay (johngay at domain eircom.net)
Date: Fri 17 Aug 2001 - 20:26:32 IST


After several sugestions that I needed to file system modules as well, on the
Advice of the original instigator of using nbd for local floppy access, I
added the msdos and fat modules to the floppy module the workstation loads on
boot-up. Now I can mount the floppy from a root shell on the workstation! YEA
HAY!

Now I tried the nbd client from the terminal server and it connected! Even
Better! The only problem now is, I can't seem to do anything else with it.
The nbd-client connects to the nbd-server and I even get a brief light on the
floppy drive on the workstation, but nothing else seems to happen. I can't
mount /home/jgay/.dev/fd0, this command just hangs. Also, there is still the
problem with the ioctl lock-up mentioned by Jason, who has also been working
on this.

 <QUOTE>
Now here's the bad news: I can't figure out how to *stop* the
nbd-clients! 'kill' and even 'kill -9' doesn't do it and I can't unload
the nbd module either. You have to reboot to clear it. Until this is
resolved it's not a complete solution. I've looked at the source code,
but it's out of my league to debug this sort of thing. Mr. Stanford
says that the nbd-client is stuck in an ioctl loop and that is why it
cannot receive any signals. I'm inclined to believe him based on what
I've seen in the source. Anyone want to take a whack at it?
</QUOTE>

Jason has worked out how to get the nbd-client to connect based on log-in
with a script in the gdm file, but until I can be sure I can get the floppy
to mount and umount cleanly, I'll stick with starting the nbd-client by hand.
Here is the script he suggests, along with his reasoning. I don't understand
all this so I'm just taking his word for it.

<QUOTE>
2) Fix gdm. Use this scripting in /etc/X11/gdm/PreSession/Default
instead of what is currently in the docs:

        # Check for remote floppy on LTSP workstation
        if [ -b $HOME/.dev/fd0 ]; then
          FLOPSTN=${DISPLAY%%:*}
          FLOPSTN=${DISPLAY%%.*}
          /usr/local/bin/nbd-client $FLOPSTN 1025 $HOME/.dev/fd0 &
        fi

This alleviates the need to use the username to bind to the terminal.
The DISPLAY variable contains all the information we need for that. I
also used HOME instead of USER because a given user's home directory is
not always /home/$USER and the HOME variable is available. It also only
runs for users with the block device $HOME/.dev/fd0, so it discriminates
based on user, but adapts to wherever they are logging in from! :)
</QUOTE>

So, I've definitely made progress with this. Once I get this working
properly, it should be a simple matter of using the same theory for CD
access.

The end result I'm looking for is to put icon's on the KDE desktop for floppy
and CD and have them automagically mount and umount the devices on demand.
Even though I'm using KDE for the desktop, I'm using gdm for the login. And
the server is running Progeny which makes everything more interesting because
the original project is developed with RedHat, though there are .deb's, the
current config script does not reconise Progeny as a valid version. Also, the
workstation modules package installs in the wrong directory as well. This
took me a while to find and move the modules I needed to the workstation root
directory so they could be loaded.

Thanks for all the help and sugestions. They were certainly instrumental in
my getting this far. Are there any kernel hacker that care to have a look at
the ioctl loop problem in the nbd sources, or are they all down the pub ; )

Cheers,

        John Gay



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:11:43 GMT