Sunday, July 8

How to Create a Swap Partition after installation


How to Create a Swap Partition after installation

Or

How to increase size of Swap Partition

Check swap by:
·         #swapon –s
·         #cat /proc/swaps

There are two following methods for same

Method I:--

By Partition:

  1. Create partition with partition ID 82 (which is ID of Linux swap)
  2. Make swap that partition by: #mkswap /dev/sdaX
  3. On swap for use on that partition by: #swapon /dev/sdaX
  4. Add same entry in fstab file like: /dev/sdaX        swap  swap  default 0 0

Method II:--

By File:

  1. Create big file by: #dd if=/dev/zero of=/swapfile bs=1M count=1000 (creates 1GB & File size=bs*count)
  2. Make swap that partition by: #mkswap /swapfile
  3. On swap for use on that partition by: #swapon /swapfile
  4. Add following entry in fstab file like: /swapfile   swap  swap  default 0 0

No comments:

Post a Comment