HarryF1
asked on
Swap and NFS on Linux
Hello,
I'm on Linux machines and run into the following problem:
I want to run a diskless X-Terminal which runs several other services as well. Therefore it needs a little swap space which I want to provide via NFS and which I can't get to work.
I did the following (as described in man mkswap and of course I am root when doing this):
$ dd if=/dev/zero of=swapfile bs=1024 count=8192
$ mkswap swapfile 8192
$ sync
$ swapon swapfile
Everything went fine except the swapon command. It complains about a wrong argument. In the syslog I get the following lines:
Jun 3 10:09:05 host kernel: rw_swap_page: bad swap file
Jun 3 10:09:05 host last message repeated 3 times
Jun 3 10:09:05 host kernel: Unable to find swap-space signature
How can I get the swapfile working?
Harry
I'm on Linux machines and run into the following problem:
I want to run a diskless X-Terminal which runs several other services as well. Therefore it needs a little swap space which I want to provide via NFS and which I can't get to work.
I did the following (as described in man mkswap and of course I am root when doing this):
$ dd if=/dev/zero of=swapfile bs=1024 count=8192
$ mkswap swapfile 8192
$ sync
$ swapon swapfile
Everything went fine except the swapon command. It complains about a wrong argument. In the syslog I get the following lines:
Jun 3 10:09:05 host kernel: rw_swap_page: bad swap file
Jun 3 10:09:05 host last message repeated 3 times
Jun 3 10:09:05 host kernel: Unable to find swap-space signature
How can I get the swapfile working?
Harry
ASKER
That was what I wrote!! Exactly THIS does not work!
ASKER
Edited text of question
Does the procedure work on non-NFS filesystems.
This might be a first step in solving your problem.
This might be a first step in solving your problem.
ASKER
Yes, it does. Swap on local drives is no problem but as I have to use the terminal without HDD I can't use it.
Something else you could try is perform all but the last step on the NFS server, and to only do the swapon on the diskless station. (the sync you perform doesn't sync the disk on the NFS server, I suppose)
ASKER
I already tried this. I created the file on the server and just did a swapon file on the client. The result was the same.
what linux version are you using? I think there is a swap over NFS patch floating out somewhere, I'll see if I can find it. It might be included in 2.1.x, but I am pretty sure such support isn't in 2.0.x
ASKER
I'm running 2.0.30. There is a patch? Any idea where I can find it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you - this patch solved the problem!
2. use swapon /dir_name/swapfile