LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 10-07-2001, 06:47 PM   #1
Nooooobie
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: Reputation: 15
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?
 
Old 10-07-2001, 07:40 PM   #2
DMR
Member
 
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986

Rep: Reputation: 30
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.
 
Old 10-07-2001, 08:57 PM   #3
Nooooobie
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: Reputation: 15
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?
 
Old 10-07-2001, 08:58 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
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
 
Old 10-07-2001, 09:43 PM   #5
Nooooobie
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: Reputation: 15
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.
 
Old 10-08-2001, 02:06 AM   #6
DMR
Member
 
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986

Rep: Reputation: 30
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 02:10 AM.
 
Old 10-08-2001, 12:53 PM   #7
Nooooobie
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: Reputation: 15
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?
 
Old 10-08-2001, 01:23 PM   #8
Nooooobie
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: Reputation: 15
Nevermind... I found it in '/etc/rc.d/rc.local'. Thanks for the help. You guys are awesome!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
doing away with linux swap partition? kahn Linux - Hardware 3 06-26-2005 05:14 PM
Windows/Linux swap Partition scripts Linux - Software 1 06-23-2005 03:36 PM
Telling Linux what to use as its swap partition timelord726 Fedora 26 01-01-2005 11:19 PM
16 GB of RAM and Linux still uses over 1 GB of a 2 GB swap partition!? lumberjack77 Linux - Software 8 09-25-2003 02:07 PM
Swap partition in Linux mikeshn Linux - General 5 04-15-2002 11:22 AM


All times are GMT -5. The time now is 09:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration