Linux AS 3 swap question!!

Rick Stevens rstevens at vitalstream.com
Mon Feb 27 18:15:09 UTC 2006


On Sun, 2006-02-26 at 11:06 +0530, mac wrote:
> 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

You don't have to, but only 2GB will be used of the 16GB will be used.
You could use something like gparted to hack your 16GB into 8 2GB chunks
and use them if you wish.  Be very careful when using gparted--you can
screw up the partition table easily.

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

Yes.

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

I prefer swap partitions, as the filesystem isn't involved when swaps
occur.  It appears to be just a tiny bit faster.

Swap partitions always exist--even when Linux isn't running.  Swap
files aren't available until the local filesystems are mounted. 
However, swap is enabled after that step in the boot process, so swap
files will be present when swap is turned on.  Look
at /etc/rc.d/rc.sysinit and you'll see the filesystem mounts around line
485 or so, and the swap turned on around line 620 or so.

> Really appreciate your help here

Not a problem.  Glad to be of assistance.

> 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
> 
> _______________________________________________
> 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
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-              Death is nature's way of dropping carrier             -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list