EXTREME Overclocking  - Building A Diskless Folding @ Home Farm Article - Page: 4
Home | Reviews | Forums | Downloads | $ EXTREME Deals $ | RealTime Pricing | Free Magazines | Gear | Folding Stats Newsletter | Contact Us

Building A Diskless Folding @ Home Farm

Project: Folding @ Home
Date Written: November 25, 2002
Written By: Jason Rabel

 

Configuration Files (cont):

The lts.conf file is pretty basic, when you add more machines you just add a new ws00x entry. For running just folding you shouldn't need a swap file, but you can create one should you deem it necessary or you are running something else that takes up more RAM. The RCFILE_01 entry tells it to run the folding @ home script, which I will go into more detail later. I set the RUNLEVEL at 3, which will put you at the shell on the client machine so you can do some diagnostic stuff to make sure everything is working, if you set the RUNLEVEL to 4 then you will only get a prompt on the client machine which will let you telnet to the farm server. It really shouldn't matter which you set it at since they aren't going to be hooked up to anything. I leave them at 3 because if a client doesn't look like it is folding I can hook up a monitor & keyboard to try and diagnose the problem locally.

/opt/ltsp/i386/etc/lts.conf

#
# Config file for the Linux Terminal Server Project (www.ltsp.org)
#
[Default]
SERVER = 192.168.2.100
DNS_SERVER = 192.168.1.254
# SEARCH_DOMAIN = "your.domain.org"
USE_XFS = N
LOCAL_APPS = N
RUNLEVEL = 4
USE_NFS_SWAP = N
#--------------------------------------------------
[ws001]
USE_NFS_SWAP = N
SWAPFILE_SIZE = 32m
RUNLEVEL = 3
RCFILE_01 = startfah

[ws002]
USE_NFS_SWAP = N
RUNLEVEL = 3
RCFILE_01 = startfah

 

The exports file contains the directories that each client will mount. The first two are your root file system, and a swap file directory (should you ever choose to use swapping). Since the F@H client requires its own directory to do work, I created a /fah directory off of the root directory on the Farm Server, then each client gets their own directory names ws00x, the directories need to be the same as the hostname in the dhcp.conf file to be mounted correctly. When initially creating the directory, you only need the F@H executable and the config file it generates, the rest of the files will be auto-generated. Do not copy any of the other files as one of them is supposed to be unique for each machine!

Just to note again, I chose to store the folding directory on the server incase a client crashed, or had to be rebooted. If it was stored merely in RAM then you would loose all your previous work. Also you can monitor the client logs on the server much easier to make sure they are running.

/etc/exports

## LTS-begin ##
# Note, some lines might wrap because of length, each entry
# should be only one line!

/opt/ltsp/i386 192.168.2.100/255.255.255.0 (ro,no_root_squash,sync)
/var/opt/ltsp/swapfiles 192.168.2.100/255.255.255.0 (rw,no_root_squash,async)

/fah/ws001 192.168.2.100/255.255.255.0 (rw,no_root_squash,sync)
/fah/ws002 192.168.2.100/255.255.255.0 (rw,no_root_squash,sync)

## LTS-end ##

 

The rc.local file is really long, however you will only need to make a few changes to the default config file so that you are mounting the proper folding directory. BE SURE TO MAKE A BACKUP OF THIS FILE BEFORE EDITING! Look below for the section that says "Mount file systems for the FAH client.", that part you will need to add in, and the other mounting part gets commented out. I also set the DEFAULT_SERVER here. Once you feel comfortable with the config file you can delete out other stuff that is not needed, since you are really only using a small portion of the file. I highlighted the changed part in red so you could find it easier.

/opt/ltsp/i386/etc/rc.local

#!/bin/sh
#
# rc.local
#
# This script will setup the environment
# for a diskless workstation, as part of
# the Linux Terminal Server Project (http://www.LTSP.org)
#
PATH=/bin:$PATH; export PATH
. /etc/ltsp_functions

/sbin/devfsd /dev

#
# Mount /proc before /tmp, so that we can display the progress
#
echo "Mounting /proc filesystem"
mount -n -t proc /proc /proc

#
# Un-mount the initrd, to free up some space
#
umount /oldroot >/dev/null 2>&1

#
# Get the runlevel for this workstation
#
RUNLEVEL=`get_cfg RUNLEVEL 5`

#
# Find out if we want to allow local applications
#

pr_set 67 "Checking for Local Apps"

LOCAL_APPS=`get_cfg LOCAL_APPS N`

if [ "${LOCAL_APPS}" = "Y" ]; then
if [ ! -d /home ]; then
pr_warn
echo
echo "WARNING! You have Local apps enabled in lts.conf, but"
echo " you don't have the local_apps package loaded"
echo " Local apps will be disabled."
echo
LOCAL_APPS="N"
fi
fi

#
# Find out if we want to swap via NFS
#
USE_NFS_SWAP=`get_cfg USE_NFS_SWAP N`

#
# Create and mount the ramdisk as the /tmp filesystem This
# is the only place we can write files, because everything else
# is read-only.
#

pr_set 69 "Creating Ramdisk"

echo "Creating ramdisk on /tmp"
RAMDISK_SIZE=`get_cfg RAMDISK_SIZE 1024`
/sbin/mke2fs -q -m0 /dev/ram1 ${RAMDISK_SIZE}
/bin/mount -n /dev/ram1 /tmp

pr_set 70 "Setting Hostname"

HOSTNAME=`hostname`
echo "Current hostname: ${HOSTNAME}"

#############################################################
# Get the IP address of the default server. This is used for
# XDM_SERVER,TELNET_HOST and SYSLOG_HOST if any of them are
# not set explicitly. Default to '192.168.0.254' if it is NOT
# set in the config file.
#
DEFAULT_SERVER=`get_cfg SERVER 192.168.2.100`

>/tmp/mtab

#############################################################
# Load some kernel modules
#

pr_set 71 "Loading Modules"

SERIAL_MOD_LOADED="N"
PARALLEL_MOD_LOADED="N"

KERNEL_VERSION=`cut -d " " -f3 /proc/version`
MODULE_DIR=/lib/modules

for i in 01 02 03 04 05 06 07 08 09 10; do
MODULE=`get_cfg MODULE_${i}`
if [ -n "${MODULE}" ]; then
if [ "${MODULE}" = "serial" ]; then
SERIAL_MOD_LOADED="Y"
fi
if [ "${MODULE}" = "lp" ]; then
PARALLEL_MOD_LOADED="Y"
fi
case "${MODULE}" in

/*) # If it starts with a slash, we use insmod
#
MODULE_PATH="${MODULE_DIR}/${KERNEL_VERSION}${MODULE}"
/sbin/insmod ${MODULE_PATH}
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_fail
echo
echo "ERROR! loading module: ${MODULE} failed !"
echo
echo -n "Press <enter> to continue "
read CMD
exit
fi
;;

*) # Otherwise, we use modprobe
#
echo "Loading: ${MODULE}"
/sbin/modprobe ${MODULE}
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_fail
echo
echo "ERROR! loading module: ${MODULE} failed !"
echo
echo -n "Press <enter> to continue "
read CMD
exit
fi
;;
esac
fi
done

################################################################
#
# Setup the resolv.conf file
#

pr_set 72 "Setting up resolv.conf"

SEARCH_DOMAIN=`get_cfg SEARCH_DOMAIN`
if [ "${SEARCH_DOMAIN}" != "" ]; then
echo "search ${SEARCH_DOMAIN}" >/tmp/resolv.conf
fi

DNS_SERVER=`get_cfg DNS_SERVER ${DEFAULT_SERVER}`
echo "nameserver ${DNS_SERVER}" >>/tmp/resolv.conf

NFS_SERVER=`get_cfg NFS_SERVER ${DEFAULT_SERVER}`

################################################################
#
# Setup swap
#
if [ "${USE_NFS_SWAP}" = "Y" ]; then
pr_set 73 "Checking for NFS swap"
modprobe nfsswap
mkdir /tmp/swapfiles
SWAPFILE=/tmp/swapfiles/${HOSTNAME}.swap
SWAP_SERVER=`get_cfg SWAP_SERVER ${NFS_SERVER}`
NFS_SWAPDIR=`get_cfg NFS_SWAPDIR /var/opt/ltsp`
pr_set 74 "Mounting swapfiles directory"
echo "Mounting swapfiles directory"
mount -t nfs -o rsize=2048,wsize=2048,nolock \
${SWAP_SERVER}:${NFS_SWAPDIR}/swapfiles \
/tmp/swapfiles
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_set 74 "Mounting of swap filesystem failed, err=${ERR}"
pr_fail
echo "Mounting of swap filesystem failed, err=${ERR}"
echo "Attempted to NFS mount ${SWAP_SERVER}:${LTSP_SWAPDIR}"
echo -n "Press <enter> to continue "
read CMD
exit
else
pr_set 75 "Preparing swapfile"
SWAPFILE_SIZE=`get_cfg SWAPFILE_SIZE 64m`
/sbin/prep_swap -s ${SWAPFILE_SIZE} -f ${SWAPFILE}
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_set 75 "Error creating swapfile, ERR=${ERR}"
pr_fail
echo "Error creating swapfile, ERR=${ERR}"
echo -n "Press <enter> to continue "
read CMD
exit
fi
pr_set 80 "Formatting Swapfile"
mkswap ${SWAPFILE}
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_set 80 "Error running mkswapswapfile, ERR=${ERR}"
pr_fail
echo "Error running mkswapswapfile, ERR=${ERR}"
echo -n "Press <enter> to continue "
read CMD
exit
fi
pr_set 83"Enabling swap via NFS"
echo "Enabling swap via NFS"
swapon ${SWAPFILE}
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_set 83 "swapon failed, ERR=${ERR}"
pr_fail
echo "swapon failed, ERR=${ERR}"
echo
echo "Are you sure the NFS/Swap patch has "
echo "been applied to the workstation kernel?"
echo
echo -n "Press <enter> to continue "
read CMD
exit
fi
fi
fi

##################################################################
#
# Mount filesystems for the FAH client.
# The stucture of the mount directory is
# /fah/name_of_workstation Eg /fah/ws001
# The mount point is the same for all workstations:
# /fah
#

if [ "Y" = "Y" ]; then
pr_set 85 "Mounting additional filesystems"
echo "Mounting additional filesystems..."
mount -t nfs -o nolock ${NFS_SERVER}:/fah/${HOSTNAME} /fah
fi

##################################################################
#
# Mount filesystems
#
#
# if [ "${LOCAL_APPS}" = "Y" ]; then
# pr_set 85 "Mounting additional filesystems"
# echo "Mounting additional filesystems..."
# mount -t nfs -o nolock ${NFS_SERVER}:/home /home
# fi

pr_set 86 "Setting up loopback device"
echo "Setting up loopback device"
ifconfig lo 127.0.0.1 netmask 255.0.0.0 broadcast 127.255.255.255

mkdir /tmp/compiled
mkdir /tmp/var
mkdir /tmp/var/run
mkdir /tmp/var/log
mkdir /tmp/var/lock
mkdir /tmp/var/lock/subsys
mkdir /tmp/var/lib
mkdir /tmp/var/lib/xkb
mkdir /tmp/mnt

################################################################
#
# Check the hostname
#

echo "127.0.0.1 localhost ${HOSTNAME}" >/tmp/hosts
echo "${DEFAULT_SERVER} server" >>/tmp/hosts

################################################################
#
# Setup the hosts.equiv file
#
echo "${DEFAULT_SERVER}" >/tmp/hosts.equiv

################################################################
#
# Start the syslog daemon
#
pr_set 88 "Starting syslogd"
SYSLOG_HOST=`get_cfg SYSLOG_HOST ${DEFAULT_SERVER}`
echo "Starting syslogd"
echo "*.* @${SYSLOG_HOST}" >/tmp/syslog.conf
syslogd -m 60 -R ${SYSLOG_HOST}

################################################################
#
# Local app daemon stuff
#
if [ "${LOCAL_APPS}" = "Y" ]; then
pr_set 90 "Starting Portmapper"
echo "Starting portmapper"
portmap

pr_set 91 "Starting xinetd"
echo "Starting xinetd"
xinetd

NIS_SERVER=`get_cfg NIS_SERVER`
if [ "${NIS_SERVER}" != "" ]; then
pr_set 92"Setting NIS server"
echo "Setting NIS Server"
echo "ypserver ${NIS_SERVER}" >>/etc/yp.conf
fi

pr_set 93 "Setting domainname"
echo "Setting domainname"
NIS_DOMAIN=`get_cfg NIS_DOMAIN "ltsp"`
echo domainname ${NIS_DOMAIN}
domainname ${NIS_DOMAIN}

pr_set 94 "Starting ypbind"
echo "Starting ypbind"
if [ -z "${NIS_SERVER}" ]; then
ypbind -broadcast
else
ypbind
fi

#
# Need to give ypbind a chance to bind to the server,
# hopefully this is long enough
#
sleep 1

fi

#################################################################
#
# Run the additional rc files.
# These are to make it easier to integrate additional
# functionality into an ltsp system. Add your scripts to etc/rc.d,
# and put the name of the script in the lts.conf file, and it will
# be executed.
#

pr_set 95 "Checking for rcfiles"
for i in 01 02 03 04 05 06 07 08 09 10; do
RCFILE=`get_cfg RCFILE_${i}`
if [ -n "${RCFILE}" ]; then
if [ -x /etc/rc.d/${RCFILE} ]; then
/etc/rc.d/${RCFILE}
else
pr_fail
echo
echo " ERROR: RCFILE_${i} is setup in lts.conf, but"
echo " it does not exist in the /etc/rc.d directory"
echo
echo -n "Press <enter> to continue "
read CMD
fi
fi
done

pr_set 100 "Completed"

 

 





EXTREME Overclocking Newsletter
Thousands of PC enthusiasts are already subscribed to the EXTREME Overclocking Newsletter, have you signed up yet?
Your Email Address:
Sponsored Links
Latest Reviews
Most Downloaded Files
Recently Added Files
CPU-Z 1.455/16/08
Compare Prices On Top Brands!
Search:
For:

Intel Core 2 Processors
Kentsfield (LGA 775)
QX6850  QX6800  QX6700  Q6700  Q6600
Conroe (LGA 775)
X6800  E6850  E6750  E6700  E6600  E6550  E6420  E6400  E6320  E6300
Allendale (LGA 775)
E4500  E4400  E4300

AMD Athlon 64 Processors
Brisbane (AM2) X2
5000+  4800+  4400+  4000+  BE-2350  BE-2300
Windsor (Socket F) X2
FX-74  FX-72  FX-70
Windsor (AM2) X2
FX-62  6400+  6000+  5600+  5400+  5200+  4600+  4200+  3800+
Orleans (AM2)
4000+  3800+  3500+  3200+  3000+

AMD Opteron Processors
Santa Rosa (Socket F)
2224 SE  2222 SE  2220  2218 HE  2216 HE  2214 HE  2212 HE  2210 HE
Santa Ana (AM2)
1222  1220  1218  1216  1214  1212  1210
Santa Ana (AM2)
1216 HE  1214 HE  1212 HE  1210 HE
Denmark (939)
185  180  175  170  165

DDR3 Memory
PC3-14400  PC3-12800  PC3-11000  PC3-10666  PC3-10600  PC3-8500

DDR2 Memory
PC2-9600  PC2-8500  PC2-8000  PC2-7200  PC2-6400  PC2-5400  PC2-5300  PC2-4200

DDR Memory
PC-4200  PC-4000  PC-3500  PC-3500  PC-2700

Motherboards
ABIT  ASUS  AOpen  Biostar  DFI  Gigabyte  Intel  MSI  Shuttle  Tyan

Video Cards
ATi  BFG  Leadtek  MSI  nVidia  PowerColor  PNY  Sapphire  Visiontek  XFX

Hard Drives
Seagate  Maxtor  Samsung  Fujitsu  Western Digital

  Technology Magazines FREE to Qualified Professionals.
eWeek MagazineeWeek is the essential technology information source for builders of e-business. Focuses on e-commerce, communications and Internet-based architecture. Oracle MagazineOracle Magazine contains technology-strategy articles, sample code, tips, Oracle and partner news, how-to articles for developers and DBAs, and more. Dr. Dobb's JournalDr. Dobb's Journal enables programmers to write the most efficient and sophisticated programs and help in daily programming quandaries. InformationWeekInformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
  Other Popular Titles: PC Magazine, BusinessWeek, Baseline, Business Solutions, Software Magazine, InfoStor, Security Source , TelevisionWeek, more...
  EXTREME Deal Of The Day | More EXTREME Deals
Dell Home - Dell Inspiron 518 Mini Tower with Core 2 Quad Processor, 4GB Memory, 640GB HD, DVD Burner, plus 20" LCD Monitor for $649 with FREE Shipping!
$649 buys you a Dell Inspiron 518 with 2.4Ghz Intel Core 2 Quad Q6600 processor, 4GB of DDR2 SDRAM, 640GB hard drive, 16x DVD+/-RW double layer burner, 7.1 sound, Windows Vista Home Premium 64-bit, a 1 year warranty, plus a 20" widescreen Dell E207WFP LCD monitor!  Expires 11/27/08.  DELL INSPIRON 518 MINI DESKTOP DEAL

  • Update: For $449 plus shipping, get a Dell Inspiron 530 with 2.4Ghz Intel Core 2 Quad Q6600 processor, 3GB of DDR2 SDRAM, 500GB HD, 16x DVD+/-RW double layer burner, Windows Vista Home Premium, and a 1 year warranty!  DELL INSPIRON 530 MINI DESKTOP DEAL
Dell Small Business - Black Friday Deals!
Dell Small Business released their Black Friday deals early!  The deals will expire on different days though, so don't delay too long if you find one you want.  The $499 Vostro 1510 laptop, $389 Vostro 200 Mini Tower, and $99 SE178WFP 17" LCD Monitor are especially hot.  DELL BLACK FRIDAY DEALS

  • Update: Use coupon code: 9Q26N641C6QSDC for 20% off select electronics & accessories, excluding Gaming, TV's, Software Licensing, Power, Batteries, Monitors, dell docking stations, Cameras, Camcorders, and printer consumables, expiring 11/25/08.  DELL ELECTRONICS & ACCESSORIES DEALS
Copyright © 2000-2008 EXTREME Overclocking. All rights reserved.
Disclaimer of Liability - Privacy Policy