Swapping over the network
How to set up swap over the
NetworkBlockDevice (NBD):
- Get the NBD package from http://sourceforge.net/project/showfiles.php?group_id=13229
- Install the NBD package on the server you want to use and start it (you may use any regular file or block device):
-
# dd if=/dev/zero of=/swaps/mytarget.bin bs=1024 count=65536
-
# nbd-server 1234 /swaps/mytarget.bin
- Install the NBD client on the target. Comment out the line in configure.ac and run autoconf if you don't have glib installed for the target compiler.
- Load the nbd kernel module on the target and create the /dev/nbd* devices if you're not using mdev or udev:
- Run the NBD client on the target:
-
# nbd-client <server-ip> <server-port> /dev/nbd0
- Set up swap space on the NBD (only necessary the first time):
- Use the swap space