Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Swap and NFS on Linux

Posted on 1997-06-04
11
Medium Priority
?
292 Views
Last Modified: 2013-12-23
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
0
Comment
Question by:HarryF1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
  • 2
  • +1
11 Comments
 

Expert Comment

by:james_zhang
ID: 1582120
1. You should be root to turn on swap
2. use swapon /dir_name/swapfile
0
 

Author Comment

by:HarryF1
ID: 1582121
That was what I wrote!! Exactly THIS does not work!
0
 

Author Comment

by:HarryF1
ID: 1582122
Edited text of question
0
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 

Expert Comment

by:tryx
ID: 1582123
Does the procedure work on non-NFS filesystems.
This might be a first step in solving your problem.
0
 

Author Comment

by:HarryF1
ID: 1582124
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.

0
 

Expert Comment

by:tryx
ID: 1582125
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)
0
 

Author Comment

by:HarryF1
ID: 1582126
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.

0
 
LVL 1

Expert Comment

by:strobert
ID: 1582127
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
0
 

Author Comment

by:HarryF1
ID: 1582128
I'm running 2.0.30. There is a patch? Any idea where I can find it?
0
 
LVL 1

Accepted Solution

by:
strobert earned 800 total points
ID: 1582129
the URL for swap over NFS (2.0.x patch):
http://www.linuxhq.com/patch/20-p0530.html

www.linuxhq.com basically collects almost every kernel patch... good place to look.
0
 

Author Comment

by:HarryF1
ID: 1582130
Thank you - this patch solved the problem!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question