Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Friday 1 November 2013

Swap Space in linux


1. To setup swap space on a newly created partition :
# mkswap /dev/sdb3

2. To enable the swap partition :
# swapon /dev/sdb3

3. To enable the above swap device at boot time, add the below line to /etc/fstab

/dev/sdb3 swap swap defaults 0 0

4 To create a swap file:

a. Create an empty file
# dd if=/dev/zero of=/swapfile bs=1024 count=65536

b. Create swap space on the file
# mkswap /swap-file

c. Enable the swap file
# swapon /swap-file

d. Add the below line to /etc/fstab
/swap-file swap swap defaults 0 0

5. To remove a swap file

a. Disable swap on the file
# rmswap /swap-file
b. Remove the corresponding entry in /etc/fstab
c. Delete the file
# rm /swap-file

No comments:

Post a Comment