LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices


Reply
  Search this Thread
Old 02-03-2006, 03:47 AM   #1
curos
Member
 
Registered: Aug 2003
Distribution: Slackware
Posts: 72

Rep: Reputation: 15
how much swap do i have?


So I installed slackware and when I ran 'top', the line where it displays my Swap was:

Swap: 0k total, 0k used, 0k free, 148404k cached

did I somehow forget to setup a swap space? Or is it supposed to be like that? how do i check how much swap space I have?

So if I don't have a swap, how do I set one up now?
 
Old 02-03-2006, 04:44 AM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
It sounds like you don't have any swap setup. You can use fdisk to see whether any of the partitions on your hard disk/s are set up as swap with /sbin/fdisk -l /dev/hda or /dev/hdb, etc. If you have a swap partition, you can run mkswap and swapon on it and add it to /etc/fstab with something like:

Code:
/dev/hda10  swap  swap  defaults  0  0
Alternatively, you can use a swap file instead of a swap partition. All of this depends on how much RAM you have and what you're using it for. Have a look at http://www.redhat.com/docs/manuals/l...ap-adding.html and http://www.tldp.org/HOWTO/Partition/....html#SwapSize while keeping in mind there's a lot of debate about how useful swap is these days given how much RAM is in a typical system.
 
Old 02-03-2006, 04:57 AM   #3
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,508
Blog Entries: 2

Rep: Reputation: 68
Hi,
To check how much swap space you have, the command "swapon -s" will show something like that:
Filename Type Size Used Priority
/dev/hda5 partition 2104472 3108 -1

You need to have an unpartitioned space on one disk or you may install an old disk from your pile of trash :-) This is exactly my case. I have installed a old 10GBytes as a slave drive on the secondary IDE just for swap !

Anyway, use fdisk to create a partition for swap. Mark this partition as type 82 (Linux swap).
Them, "mkswap -c /dev/whatever" will create the swap structure on the specified partition.
The "-c" option is important for old disks because it will test the integrity of space.

How much space you need ? Well, there are several factors to take in account, but for personal systems with 512MBytes or less, 1G will be nice. Some people have the opinion that personal systems with 1G don't need swap at all.
Don't create a swap space very big, let say, >1G. It's better to have several smaller swap spaces rather than a multi-giga swap space. This is specially true if the swap space are in different disks. Again, I am talking about personal systems in regular hardware.

To activate the swap right now, issue the command "swapon /dev/whatever".
To activate the swap space at the next reboot, add the following line to your /etc/fstab file.
/dev/whatever swap swap defaults 0 0
 
Old 02-03-2006, 01:59 PM   #4
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 68
Quote:
Originally Posted by marozsas
How much space you need ? Well, there are several factors to take in account, but for personal systems with 512MBytes or less, 1G will be nice. Some people have the opinion that personal systems with 1G don't need swap at all.
I have a 1 gig swap partition on mine, and I RARELY use more than 10% of it....And thats only when I have 2-3 Xserver sessions going at once (And I only have 256MB of memory, shared with my video...lol)
 
  


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
Linux swap / solaris not appearing as swap in Ubuntu? Erik_the_Red Linux - Newbie 1 07-30-2005 12:57 PM
swap? berrance Linux - Distributions 5 03-03-2005 06:10 PM
Swap not being used provo1234 Linux - General 4 02-01-2005 10:35 PM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 07:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation

All times are GMT -5. The time now is 09:25 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
Open Source Consulting | Domain Registration