Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-07-2001, 05:47 PM
|
#1
|
LQ Newbie
Registered: Aug 2001
Location: Pensacola, FL
Distribution: Win98+WinLinux+Red Hat 7.1 on one system Win98+Peanut 8.4 on the other.
Posts: 27
Rep:
|
making Linux use a swap partition
I just installed Peanut-Linux 8.4 on my other computer, and I need to make it start using the swap partition. I already created the swap partition with mkswap, but the system doesn't use it yet. What files do I edit, and what commands do I use?
|
|
|
10-07-2001, 06:40 PM
|
#2
|
Member
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986
Rep:
|
Make sure your fstab file has a line which indicates where swap should be mounted at boot. I'm not familiar with Peanut Linux, but in most distros the fstab file lives in /etc. There should be a line similar to:
Code:
/dev/hdx swap swap defaults 0 0
where the "x" is the number of the partition you designated as swap.
|
|
|
10-07-2001, 07:57 PM
|
#3
|
LQ Newbie
Registered: Aug 2001
Location: Pensacola, FL
Distribution: Win98+WinLinux+Red Hat 7.1 on one system Win98+Peanut 8.4 on the other.
Posts: 27
Original Poster
Rep:
|
Ok, I did that, and rebooted, but 'df' is still only showing one partition. Should 'df' show the swap if it's mounted? What else should I try?
|
|
|
10-07-2001, 07:58 PM
|
#4
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
after you create the swap partition... you can use the swapon to start using it...
check out this site for more details http://linux.com/develop/man/8/mkswap or type man mkswap
|
|
|
10-07-2001, 08:43 PM
|
#5
|
LQ Newbie
Registered: Aug 2001
Location: Pensacola, FL
Distribution: Win98+WinLinux+Red Hat 7.1 on one system Win98+Peanut 8.4 on the other.
Posts: 27
Original Poster
Rep:
|
If I type 'swapon' it just shows usage. If I type 'swapon -a', I get:
swapon: /dev/hda2: Device or resource busy
...but 'df' still doesn't show my swap. In '/etc/fstab' I tried each of these lines:
/dev/hda2 swap swap defaults 0 0
/dev/hda2 none swap sw 0 0
/dev/hda2 swap swap sw 0 0
...the swapon man page says 'swapon -a' makes all devices labeled 'sw' in '/etc/fstab' available.
|
|
|
10-08-2001, 01:06 AM
|
#6
|
Member
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986
Rep:
|
Swap usage isn't reported by df. To identify which partition is allocated as swap (and what % of that partition is actually being utilized), use "swapon -s".
Regarding "swapon -a", note that the man page states that "devices that are already running as swap are silently skipped", meaning that they shouldn't be displayed in the output. I'm not sure why you got the "device or resource busy message" when you did "swapon -a" though.
Last edited by DMR; 10-08-2001 at 01:10 AM.
|
|
|
10-08-2001, 11:53 AM
|
#7
|
LQ Newbie
Registered: Aug 2001
Location: Pensacola, FL
Distribution: Win98+WinLinux+Red Hat 7.1 on one system Win98+Peanut 8.4 on the other.
Posts: 27
Original Poster
Rep:
|
oops!
Sorry, I was confused. 'swapon -s' shows my swap partition, but it also shows a swap file (/mnt/swap/swap.img). I saw the file in /etc/fstab, but it's commented out. It's wasting 32MB of disk space, and I want to get rid of it. How is it still activated at bootup? How can I disable it?
|
|
|
10-08-2001, 12:23 PM
|
#8
|
LQ Newbie
Registered: Aug 2001
Location: Pensacola, FL
Distribution: Win98+WinLinux+Red Hat 7.1 on one system Win98+Peanut 8.4 on the other.
Posts: 27
Original Poster
Rep:
|
Nevermind... I found it in '/etc/rc.d/rc.local'. Thanks for the help. You guys are awesome!
|
|
|
All times are GMT -5. The time now is 07:50 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|