[Pkg-ltsp-devel] network swap options

Vagrant Cascadian vagrant at freegeek.org
Mon Aug 21 22:56:05 UTC 2006


i've been wondering a bit about our network swap options...

what's the status of ltspswapd?  as i understand it, it's a patched
nbd-server that creates the swap files on the fly, rather than having to
precreate them... that would be nice.

ogra also suggested hooking into udev for swap creation with local
disks- might be able to do that for nbd devices as well.

i tried out using cryptsetup and nbd to get an encrypted swap.
worked pretty well, at least for two clients(one qemu, and one real).

/opt/ltsp/i386/etc/nbd-client:

NBD_DEVICE[0]=/dev/nbd0
NBD_TYPE[0]=r
NBD_HOST[0]=server
NBD_PORT[0]=1235

i had to start the nbd-server manually...

nbd-server 1235 /opt/ltsp/swap/swapfile.%s

(need to figure out why it wouldn't run from /etc/init.d/nbd-server)

/opt/ltsp/i386/etc/rc2.d/S21encrypted_swap:

#!/bin/sh                                 
modprobe dm_crypt                       
/sbin/cryptsetup -d /dev/urandom create swap /dev/nbd0
mkswap /dev/mapper/swap                 
swapon /dev/mapper/swap                 

unfortunately, we can't run this directly from ltsp-client or
ltsp-client-setup, because nbd-client doesn't run until after both of
them(S20nbd-client), though we could move /etc/rc2.d/S20ltsp-client to
S25ltsp-client and just merge the encrypted swap code. i don't see that
that would break anything ...

live well,
  vagrant



More information about the Pkg-ltsp-devel mailing list