0

I'm a newbie to RHEL.I've installed RHEL 7 using VMware .but,during the installation ,it asked me to create Swap partition and i created it worth 2GB. please brief me the reasons.what if the swap partition is not created?can i create swap file instead of swap partition after installation?

1 Answer 1

0

If the tasks running in the Virtual Machine will always use less Memory&Cache than you have allocated RAM to the VM, then you will never need SWAP.

Most Installers let you do this (Install w/o a SWAP Partition/File), after warning you, that you should be very sure about your requirements.

If you still want Swap you should know: Swap Files are slower than Swap Partitions.

To answer your Question: Yes, you can use a Swap file instead of a Swap partition, and you should be able to change the setup post-installation.

The general steps are:

  1. dd if=/dev/zero bs=1M count=2048 of=/path/to/wanted/swapfile/location
  2. mkswap /path/to/wanted/swapfile/location
  3. swapon /path/to/wanted/swapfile/location
  4. swapoff /dev/sdXN # The old swap partition
  5. edit /etc/fstab to point to new swap file
1
  • I have done similar on Debian Linux dozens of times. Commented Aug 9, 2015 at 16:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .