Tricks

From WikiWiki

Jump to: navigation, search

====Adding swap to your diskless machine

[edit] ==

32 MB isn't enough to run some apps. apt-get for example (or dpkg) won't run.

But you can't add swap over NFS.... Or can you?

You need an NFS server to do this.

Set up a swap directory and create a swap file in in. See mkswap docs (man mkswap) on how to do this.

Now mount it via nfs

mount -t nfs 192.168.1.3:/home/panel/swap /swap

and tell swap about it:

losetup /dev/loop0 /swap/swapfile

swapon /dev/loop0

The trick is that you can't use an nfs mount for swap. So you mount it first on /dev/loopX, and then use that. It works....

Personal tools