Author Topic: swap partition and swap file  (Read 401 times)

hameedkm

  • Blue Belt
  • ****
  • Posts: 111
  • Karma: +0/-0
swap partition and swap file
« on: September 19, 2013, 04:33:56 PM »
Hello,

Explain Difference between swap partition and swap file?

Thanks

afsalabdulla

  • Green Belt
  • *****
  • Posts: 218
  • Karma: +0/-0
Re: swap partition and swap file
« Reply #1 on: September 19, 2013, 04:34:38 PM »
Hai,

Swap partition maintained seperate partition. same swap partition can be used in two OS within single machine.
If system crashes their is a chance to recover itor may not be corrupt the partition.
Less fragmented.
where as swap file takes very less space. we can increase the space very easily, compared to swap partition. SWap file system fragmented. If system crashes their is a huge chance to lost the swap file system.

Thanks
afsal

mithundatasoft

  • Orange Belt
  • ***
  • Posts: 72
  • Karma: +0/-0
Re: swap partition and swap file
« Reply #2 on: September 20, 2013, 06:30:26 AM »
Hello

Swap file == slow, slow performance, ext3/ext2 format, not dedicated
Swap partition == good performance, dedicated for swapping only, in swap format

Always use swap partition and make sure it is double the RAM size (<=2Gig)

Thanks

arjun.datasoft

  • Blue Belt
  • ****
  • Posts: 180
  • Karma: +0/-0
Re: swap partition and swap file
« Reply #3 on: September 27, 2013, 01:18:51 AM »
Hi,

In Linux OS, Reserved disk block in the hard drive used for swapping is known as Swap Partition; no other files can be located in swap partition.
If physical memory is not sufficient amount to allocate more memory, requested by processes of application in the system, then the kernel swaps out pages which are not frequently used or unused. And it allocates memory to the required process that wants the memory instantly.
In time of Linux OS installation, we have to set the partition size two times of Ram size, which is recommended. For example if RAM size is 2GB then swap partition will be 4GB. In windows OS swap space or partition is called page file.
   

The swap file is not a common file. Itís has special nature which exist in the midst of your system and data files. Swap file free RAM space by transfer unused program to hard drive and allocate that space to currently requested program.
Creation and preparation of swap file is similar to creation of swap partition. Swap files do not require an empty partition and no need to repartition hard drive to add additional swap space.
Swap file can increase at any time proportion to request, which is another benefit of it.

Thanks