Re: Swap space

"Andreas Lund" <[email protected]> Sun, 3 Nov 2004 09:25:53 -0000
Newsgroups gmane.linux.redhat.release.valhalla
Message-ID <[email protected]>
Tue, 2 Nov 2004 15:34:14 -0000, "Harry Hambi" <[email protected]> wrote:
> Hi All,
> Trying to find out how much swap I have......remember configuring a swap
> file when I installed linux 7.2. the command I use is df -f ..no
> mentioned of a swap, how do you change the size of the swap space?.

Type "free", the last line tells you the total swap space, how much is in use
and hos much is free. Here's what mine looks like:

# free 
             total       used       free     shared    buffers     cached
Mem:        513640     500984      12656          0      90064     334584
-/+ buffers/cache:      76336     437304
Swap:       481940      29696     452244


In Linux, you don't use a swap file but rather one or more swap partitions.
This means swap performance and reliability won't be affected by a fragmented
or busy file system, but the downside is you have to re-partition (or add a
new drive) if you want to change the size later on.

Here's what the main drive looks like on one of my servers:

# fdisk -l /dev/sda

Disk /dev/sda: 255 heads, 63 sectors, 1106 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sda1   *         1       523   4200966   83  Linux
/dev/sda2           524      1046   4200997+  83  Linux
/dev/sda3          1047      1106    481950   82  Linux swap


Swap partitions are usually turned on by /etc/rc.sysinit during boot, but you
can also turn swap partitions on and off manually using the swapon/swapoff
commands to avoid unnecessary reboots.

Notice the partition type 0x82 meaning "Linux swap"


--
Andreas Lund ([email protected]) - Net.adm - http://www.atc.no
Tel: +47 90.07.71.62 / +47 63.88.33.57  Fax: +47 21.69.09.10
Ano-Tech Computers AS - Din interaktive leverandør
** He had a baseball bat and I was tied to a chair. 
** Pissing him off was the smart thing to do.  -- Max Payne