VMware Training from VMTraining
Partner LoginPartner Login
   Home   Search Login Register  
May 18, 2012, 01:21:05 AM
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Learn VMware View 4 in a THREE day course! Click here for more details about our View 4 class.
 
Pages: [1]   Go Down
  Print  
Author Topic: Swap Partition  (Read 1661 times)
pizzoja
Newbie
*
Offline Offline

Posts: 6


« on: May 12, 2008, 01:23:21 PM »

Hi,  I have already installed ESX 3.01 on multiple server and would like to  know if here is anyway to resize the swap partion without having to completely reinstall?

Thanks,


Joel
Logged
VMT1
Global Moderator
Newbie
*****
Offline Offline

Posts: 13


« Reply #1 on: May 13, 2008, 12:47:19 AM »

Joel,

The SC swapfile is a partition on the disk. If you have free space after installation, which most people do not, you could create another swap partition and have 2 swap partitions. If you however do not have the space on the drive to make a new partition, you can also use a file for a swap location similar to pagefile.sys if you are a Windows person. However, this is strongly discouraged . If you do have to swap you will end up hammering the filesystem upon which it resides.

Now a bit of trivia. Swap partitions can be any size, however anything over 2GB per swap partition are ignored. You can have up to 32 swap partitions/files.

To create a second Swap Partition, you would use the following:

Create a swap partition:
fdisk /dev/sd?

Make the swap file:
mkswap /dev/sd?

Edit /etc/fstab
Copy the swap definition in there already and change the /dev/sd? to be the appropriate device

Run
swapon -a

That is how you add a secondary swap partition.

To add a swap file only ...

First create a 65MB swap file:
dd if=/dev/zero of=/pathToSwap/swapFileName bs=1024 count=65536

pathToSwap could be anything but I would put it in /var or even /tmp, depends on where you have separate filesystems. Do NOT use NFS (it does not work) and I would avoid any VMFS as well. Unless absolutely necessary avoid remote storage altogether.

swapFileName can be anything as well.

This one however requires you to edit /etc/rc.d/rc.local to add
swapon /pathToSwap/swapFileName

The recommendation is that you do not have the disk space to create a second swap partition, then reinstall with the proper sized swap partition which is generally 2x memory needed for the Service Console.
For more information from the SC issue:
man mkswap
man swapon
Logged
dougbunger
CVE Instructor
Newbie
*****
Offline Offline

Posts: 1


« Reply #2 on: May 14, 2008, 05:54:50 PM »

As a small point of clarification, I tested this on one of VM Training's development servers, and a swapfile will not run on a VMFS share.  So Jeff's statement of "avoid VMFS" should be "don't use VMFS".
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

  Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC  

VMware Training, Global Locations

VMTraining is a division of Global Training Solutions, Inc.
© GLOBAL TRAINING SOLUTIONS, INC. 2007 - 2012

Contact us at (815) 313-4472 or Sales@VMTraining.net

To report technical problems,
please email webmaster@vmtraining.net