[K12OSN] usb/pen/thunbdrives& floppy access>this works!

Barry R Cisna brcisna at frontiernet.net
Sat Apr 16 19:16:48 UTC 2005


Hello List,,
    Thought this cut & paste may be of some use to some souls trying to get
both floppy & usb drives/pendrives to work. This setup does ,actually work.
I have it working on four servers ,running K12LTSP v 4.2.0. You just need to
add& adjust a few of the existing conf files ,on your k12ltsp servers for
the clients to get access to both floppy & usb /pen drives.I could always
get either floppy OR usb drives to work but not both ,till I found this
setup!
    This MAY keep staff happy and make K12LTSP a better "selling
point"..with this scenario.
Have a good one.

    Barry---

    3.5.1. Accessing local drives with Linux sessions
We said earlier that using a Linux session on a workstation means receiving
display from the LTSP server and all what you see runs on the LTSP server.
Thus, accessing drives on the workstation returns to a remote access from
the LTSP server to the local drives on the workstation

3.5.1.1. Using floppyd
Floppyd is used as a server to grant access to the floppy drive to clients
running on a remote machine, just as an X server grants access to the
display to remote clients. floppyd is always associated with an X server. It
runs on the same machine as its X server, and listens on port 5703 and
above.

mtools is a collection of tools to allow Unix systems to manipulate MS-DOS
files: read, write, and move around files on an MS-DOS filesystem (typically
a floppy disk) without mounting/unmounting it. MtoolsFM is a little file
manager that uses mtools and has a nice GUI.

     Note
      When you connect using a Linux session, you will see an icon on the
desktop named "Floppy access" which launches MtoolsFM.


  a.. To use floppyd on the workstation to grant access to the floppy drive

    a.. Add the following line in /opt/ltsp/i386/etc/lts.conf at the end of
the workstation's section

[workstation_name]
	...

	# start floppyd to access the floppy drive (listen on port 5703)
	RCFILE_01 = floppyd
b.. Reboot the workstation

  b.. To access the floppy drive from a Linux session

    a.. Make sure that /etc/mtools.conf contains only the following lines

# Assign drive "a:" to floppy
drive a: file="$DISPLAY" mtools_skip_check=1 remote
b.. Create a file named /etc/mtoolsfm.conf and put the following lines in it

# MToolsFM config file. comments start with a hash sign.
#
# This variable sets the allowed driveletters (all lowercase). Example:
# DRIVES="ab"
DRIVES="a"
#
# This variable sets the driveletter upon startup in the left window.
# An empty string or space is for the hardisk. Example:
# LEFTDRIVE="a"
LEFTDRIVE=""
#
# This variable sets the driveletter upon startup in the right window.
# An empty string or space is for the hardisk. Example:
# RIGHTDRIVE="a"
RIGHTDRIVE=""
c.. Use the mtools commands or the MtoolsFM GUI

Many USB keys are preformatted with a MS-DOS filesytem. This means that it
is possible to access the USB keys with floppyd. The procedure is outlined
below (for more details, see USB Storage in the K12LTSP wiki)

  a.. To use floppyd on the workstation to grant access to the USB key

    a.. Create a directory called dev-files containing the device file sda1.
This is because USB keys are generally assigned /dev/sda1 under a Linux
system

# mkdir /opt/ltsp/i386/dev-files
# MAKEDEV -d /opt/ltsp/i386/dev-files -x sda1
b.. Create the file /opt/ltsp/i386/etc/rc.d/usbkey containing the following
and make it executable

#!/bin/bash
#
# First, since floppyd runs as nobody, make /tmp world accessible.
#
chmod 777 /tmp
#
#copy the previously created device node
#
mkdir /tmp/dev
cp -a /dev-files/sda1 /tmp/dev/sda1
#
# and make it world accessible
#
chmod 666 /tmp/dev/sda1
#
# Finally, start floppyd.
#
# In order to have access to both floppy and USB keys, we tell floppyd
# to listen on port 5704.
floppyd -l -s 5704 -d /tmp/dev/sda1
# chmod 755 /opt/ltsp/i386/etc/rc.d/usbkey
c.. Add the following line in /opt/ltsp/i386/etc/lts.conf at the end of the
workstation's section

[workstation_name]
	...

	# Load USB Mass Storage driver
	MODULE_01 = usb-storage
	#MODULE_02 = ehci-hcd

	# start floppyd to access the USB key (listen on port 5704)
	RCFILE_02 = usbkey
d.. Reboot the workstation

  b.. To access the floppy drive from a Linux session

    a.. Modify /etc/mtools.conf so that is looks like this

# Assign drive "a:" to floppy
drive a: file="$DISPLAY" mtools_skip_check=1 remote

# Assign drive "u:" to USB key
drive u: file="$DISPLAY/5704" mtools_skip_check=1 remote
b.. Modify /etc/mtoolsfm.conf so that is looks like this

# MToolsFM config file. comments start with a hash sign.
#
# This variable sets the allowed driveletters (all lowercase). Example:
# DRIVES="ab"
DRIVES="au"
#
# This variable sets the driveletter upon startup in the left window.
# An empty string or space is for the hardisk. Example:
# LEFTDRIVE="a"
LEFTDRIVE=""
#
# This variable sets the driveletter upon startup in the right window.
# An empty string or space is for the hardisk. Example:
# RIGHTDRIVE="a"
RIGHTDRIVE=""
c.. Use the mtools commands or the MtoolsFM GUI

       Tip
        If you don't see any of the drives in MtoolsFM, then quit MtoolsFM,
delete ${HOME}/.mtoolsfm and start MtoolsFM. You can also use "Configure
MtoolsFM..." in the "Options" menu of MtoolsFM.


       Warning
          1.. You can plug/unplug a same USB key as many time as you want
but if you plug another USB key it will not be accessed because the system
assigned to it another device (likely /dev/sdb1).





More information about the K12OSN mailing list