View previous topic :: View next topic |
Author |
Message |
mjrmua n00b
Joined: 23 Feb 2005 Posts: 15
|
Posted: Fri Jun 03, 2005 12:36 pm Post subject: LUFIS mounting SSHFS for LTSP local device access |
|
|
I'm trying to get access to local devices on a LTSP 4.1.1 system.
I've been (sort of) following this howto if anyone is interested: http://www.active.ee/download/ltsp4_lda_v0.3_howto.pdf
The basic idea is to mount local devices on the terminal and then use lufis from the server to mount the terminal's mnt directory via ssh.
But I'm having some problems with lufis.
I am running this command on the server:
Code: |
lufis fs=sshfs,host=$TERMINAL,root=/tmp/mnt/,username=$USER ~/mnt -s
|
I was hoping this would mount $USER@$TERMINAL:/tmp/mnt to ~/mnt, but instead it mounts the terminals root directory, is the "root" option not the correct way to specify the directory to be mounted?
Also this command needs the user to put in his password to connect to the terminal, is there anyway to allow an ssh connection to the terminal without a password?
I hope someone here can help, there seems to be precious little documentation for lufis. |
|
Back to top |
|
|
saltine n00b
Joined: 25 Mar 2005 Posts: 24 Location: Winnipeg, Canada
|
Posted: Wed Jun 29, 2005 2:24 am Post subject: |
|
|
I have done this before with the fuse. I setup a school in Winnipeg, Canada using it. The story was briefly covered by the Gentoo Weekly Newsletter http://www.gentoo.org/news/en/gwn/20050509-newsletter.xml#doc_chap4
These are the necessary packages:
* sys-fs/fuse
Latest version available: 2.3.0
Latest version installed: 2.2_pre3
Size of downloaded files: 357 kB
Homepage: http://fuse.sourceforge.net
Description: An interface for filesystems implemented in userspace.
License: GPL-2
* sys-fs/sshfs-fuse
Latest version available: 1.1
Latest version installed: 1.0
Size of downloaded files: 83 kB
Homepage: http://fuse.sourceforge.net/
Description: Fuse-filesystem utilizing the sftp service.
License: GPL-2
And here are the mount and unmount commands:
Here is a script to mount the filesystem:
Code: | #!/bin/sh
/usr/local/bin/killlocaldev
TERMINAL=`echo $DISPLAY | cut -d: -f1`
if [ "$TERMINAL" != "" ]; then
logger "Setting up local devices for $USER on $TERMINAL"
sshfs $USER@$USER:/tmp/mnt /home/$USER/.devices -s -o default_permissions
fi |
Here is a script to unmount them:
Code: | #!/bin/sh
TERMINAL=`echo $DISPLAY | cut -d: -f1`
if [ "$TERMINAL" != "" ]; then
logger "Unmounting localdevices for $USER on $TERMINAL"
fusermount -u /home/$USER/.devices
fi |
Here is an rc script for the clients:
Code: | #!/bin/sh
# This script will set up local devices for supermount.
#
PATH=/bin:$PATH; export PATH
. /etc/ltsp_functions
#
# Get the lts.conf entries
#
eval `/bin/getltscfg -a`
FOUND_ONE="N"
for i in 01 02 03 04 05 06 07 08 09 10; do
DEVVAR=LOCAL_DEVICE_${i}
SUPERMOUNT="N"
if [ ! -z ${!DEVVAR} ] ; then
DEVICE=`echo ${!DEVVAR} | sed 's/\(.*\):.*/\1/'`
MOUNT=`echo ${!DEVVAR} | sed 's/.*:\(.*\)/\1/'`
BASE_DEVICE=`/usr/bin/basename ${DEVICE}`
FILESYSTEM=`/bin/fstyp ${DEVICE}`
if [ -z ${MOUNT} ] ; then
MOUNT=${BASE_DEVICE}
fi
echo ${DEVICE} ${MOUNT} ${BASE_DEVICE}
case "${BASE_DEVICE}" in
cdrom* ) #IDE CDROMS
modprobe isofs
sleep 3
SUPERMOUNT="Y"
;;
hd* ) # IDE HARDDRIVES
if [ "${FILESYSTEM}" = "ntfs" ] ; then
modprobe ntfs
elif [ "${FILESYSTEM}" = "vfat" ] ; then
modprobe vfat
elif [ "${FILESYSTEM}" = "ext3,ext2" ] ; then
modprobe ext3
fi
sleep 3
SUPERMOUNT="N"
;;
fd* ) # STANDARD FLOPPY
modprobe vfat
SUPERMOUNT="Y"
;;
esac
mkdir -p /tmp/mnt/${MOUNT}
if [ $SUPERMOUNT = "Y" ] ; then
modprobe supermount
mount -t supermount -o fs=auto,dev=${DEVICE} none /tmp/mnt/${MOUNT}
else
mount -t ${FILESYSTEM} ${DEVICE} /tmp/mnt/${MOUNT} -o ro,umask=000
fi
fi
done |
Add similar lines to your lts.conf
Code: | LOCAL_DEVICE_01 = /dev/cdroms/cdrom0:CDROM
LOCAL_DEVICE_02 = /dev/fd0:FLOPPY |
You will also need NIS functional or to copy the /etc/passwd and /etc/group over.
Hope that helps feel free to checkout my Recipe for Network Booting post containing a script to install ltsp under gentoo. _________________ Recipe for Network Booting |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|