1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
there are a few options to enable swap in ltsp.
(this assumes an ltsp dir of /opt/ltsp, and achitecture of i386, adjust to your
configuration if necessary)
using local swap partitions from the hard disk:
add to /opt/ltsp/i386/etc/lts.conf:
[Default]
USE_LOCAL_SWAP=Y
network swap using NBD:
touch /opt/ltsp/i386/etc/nbd-client
in /opt/ltsp/i386/etc/lts.conf:
[Default]
NBD_SWAP=Y
apt-get install nbd-server
update-inetd --group LTSP --add "9210 stream tcp nowait nobody /usr/sbin/tcpd /usr/sbin/nbdswapd"
encrypting swap space:
in /opt/ltsp/i386/etc/lts.conf:
ENCRYPT_SWAP=Y
and install the cryptsetup package:
chroot /opt/ltsp/i386 apt-get install cryptsetup
alternately, you can configure nbd-server the hard way:
apt-get install nbd-server
in /etc/nbd-server:
NBD_PORT[0]=9210
NBD_FILE[0]=/opt/ltsp/swap/swapfile.%s
NBD_SERVER_OPTS[0]=""
invoke-rc.d nbd-server start
create a file for each possible ip address that will attempt
to connect to the server:
# size in megabytes
size=100
your_ip_addresses="10.0.2.2 10.0.2.3 10.0.2.4 ..."
mkdir -p /opt/ltsp/swap/
for a in $your_ip_addresse ; do
dd if=/dev/zero of=/opt/ltsp/swap/swapfile.$a bs=1024k count=$size
done
|