LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-23-2003, 11:45 PM   #1
thejackal13
Member
 
Registered: Oct 2003
Distribution: Fedora Core 2
Posts: 39

Rep: Reputation: 15
Question Creating a swap partition


Can someone please explain to me about the swap partition. I don't beleive I have one. How can I check to see if I do, and if I don't and i should use one, how do i create one? Does it speed up linux if i do have one?
 
Old 10-24-2003, 12:13 AM   #2
misophist
Member
 
Registered: Aug 2003
Location: here
Distribution: suse 8.2
Posts: 169

Rep: Reputation: 30
Open a console and enter 'cat /etc/fstab' (sans quotes). This shows your mountable partitions. Swap is called swap and is mounted on swap with a swap file system. There should be something like this on almost any distro. I can't believe an installer would let you forget a swap partition. If you have plenty of RAM it shouldn't really matter but the people with the experience and know-how say we need one. Twice the amount of RAM is the normal size.

If you don't have one, a reinstall could be the easiest way to get one.
 
Old 10-24-2003, 09:50 AM   #3
tokyoeye
Member
 
Registered: Oct 2003
Location: Amsterdam
Distribution: gentoo,debian
Posts: 47

Rep: Reputation: 15
To see whether you have a swap partition mounted type 'cat /proc/swap' and read the output.

To create a swap partition you can use this command:
mkswap /dev/hda2

to activite the swap partition use:
swapon /dev/hda2


Note that on your system it's probably not hda2.

Hope this helps...
 
Old 10-24-2003, 01:36 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,961

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
Swap is the same thing as virtual memory on windows OS. In a nut shell ( in reality its a little more complicated ) if you run out of physical ram, non active applications and data will be exchanged between RAM and the hard drive.

I think having a swap partition is a good idea. The 2x rule IMHO is outdated with lots of RAM. A 512 partition is a good size.

The console command free will tell you if swap is active. If total swap size is a non zero value its working.

Using swap space is slower since your using the hard drive. And in most cases unless your PC is a hard core web, mail and or database server it probably will use little or no space at all. If you need swap and do not have your machine will really slow down and it might crash.
 
1 members found this post helpful.
Old 10-24-2003, 02:57 PM   #5
misophist
Member
 
Registered: Aug 2003
Location: here
Distribution: suse 8.2
Posts: 169

Rep: Reputation: 30
Since 'cat /proc/swap' won't work on my machine and 'free' may not work on yours (although it should), yet another method is ' ps -A | grep swap' which will show if the swap daemon is running.
 
Old 10-28-2003, 10:00 AM   #6
thejackal13
Member
 
Registered: Oct 2003
Distribution: Fedora Core 2
Posts: 39

Original Poster
Rep: Reputation: 15
thank you for all your help guys. Sorry I haven't replied earlier but i have been super busy with school work and stuff. But i am gonna use what was written here and take a look at it. Thanks.
 
Old 10-30-2003, 08:03 PM   #7
thejackal13
Member
 
Registered: Oct 2003
Distribution: Fedora Core 2
Posts: 39

Original Poster
Rep: Reputation: 15
Thanks tokyoeye, i did what you said i am pretty sure it worked, thanks a bunch man!!
 
  


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
Creating a swap partition on an old pc, WITHOUT using linux... TheMusicGuy Linux - General 17 08-09-2004 01:43 AM
problem creating swap partition during installation kristof Red Hat 11 07-03-2004 02:25 PM
creating swap lynos Linux - General 6 03-27-2004 08:07 AM
Creating a swap partition dsuniln Linux - Newbie 9 06-30-2003 01:18 PM
Newbie Installing Debian3 on m68k w/250M Partition Needs help creating swap partition AppleMac Linux - Newbie 2 11-01-2002 09:45 AM


All times are GMT -5. The time now is 01:09 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