Linux AS 3 swap question!!

A.Fadyushin at it-centre.ru A.Fadyushin at it-centre.ru
Sun Feb 26 15:38:39 UTC 2006


You can decrease (or increase) the size of swap partition using the same
method as for any other partition (e.g. repartition that part of disk
with fdisk). Of course, you should disable that partition (with
'swapoff' command) before changing its size, recreate its structure with
'mkswap' after changing the size and enable that partition using
'swapon'.

You can use both swap partition(s) and swap file(s) at the same time in
any combinations - e.g. 1 swap partition and 1 swap file, or 2 swap
partitions and 1 swap file, etc.

I think that a swap partition is a better approach because the access to
partitions is faster than access to the file. Swap partition and swap
file will survive the reboot. Swap partitions are exist as long as them
exist in the disk's partition table and marked as swap partitions in
/etc/fstab (entry in /etc/fstab is necessary for automatic enabling of
that partition on startup, even without such a entry the partition could
be enabled with 'swapon').  Swap files are exist as long as them are not
deleted (for example, using 'rm') from the filesystem (the entry in
/etc/fstab is used the same way as for swap partitions). Neither swap
partitions nor swap files are automatically deleted by the system.

 

Alexey Fadyushin

Brainbench MVP for Linux

http:///www.brainbench.com

 

 

________________________________

From: redhat-install-list-bounces at redhat.com
[mailto:redhat-install-list-bounces at redhat.com] On Behalf Of mac
Sent: Sunday, February 26, 2006 8:36 AM
To: Getting started with Red Hat Linux
Subject: Re: Linux AS 3 swap question!!

 

Appreciate your response ..Thanks ..i juts have a couple of queries

1)i have  a swap partion of 16 GB ...how can i go about decreasing the
size of this partition  ie the size of swap

2)Can both the swap file and partition coexist ?? 

3)WHich is a better approcah ..partition or file and which exists after
every reboot

Really appreciate your help here

Thanks

On 2/26/06, Rick Stevens <rstevens at vitalstream.com> wrote:

On Sat, 2006-02-25 at 23:09 +0530, mac wrote:
> Hi,
> We have a Linux EL AS 3 running on a poweredge server with 8 GB
> ram ...we would like to know how to change the swap space on a linux
> AS 3 system dynamically 
>
>  and would AS3 support a swap size of 16 GB
>
> any pointers appreciated

You can have up to 16 swap sections but each is limited to 2GB each,
giving a total of 32GB of swap.  You can't change the swap size 
dynamically, since the swap is on a fixed-size partition or file.  You
can enable and disable various swap files or partitions using the
swapon(8) or swapoff(8) commands.

Swap has to be either a separate partition OR a zero-filled file.  You 
probably know how to make a swap partition.  To create a swap _file_:

1. Find a partition that has enough free space for the swap you want.

2. As root, do:

        # dd if=/dev/zero of=/path/to/swap/file count=size 

For example, to create a 2GB swap file called "/var/swapfile":

        # dd if=/dev/zero of=/var/swapfile count=2G

3. Convert the file to a swap file:

        # mkswap /var/swapfile

3. Activate via:

        # swapon /var/swapfile

4. Edit your /etc/fstab file and add a line for this swap file so it'll
activate on the next boot:

        /var/swapfile   swap          swap    defaults        0 0 

Voila!

----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-        God is real...........unless declared integer or long       -
----------------------------------------------------------------------

_______________________________________________
Redhat-install-list mailing list
Redhat-install-list at redhat.com 
https://www.redhat.com/mailman/listinfo/redhat-install-list
To Unsubscribe Go To ABOVE URL or send a message to:
redhat-install-list-request at redhat.com
Subject: unsubscribe

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/redhat-install-list/attachments/20060226/ac707c56/attachment.htm>


More information about the Redhat-install-list mailing list