Swap Management


Swap Management

Vhand process
       If system is working with lotsfree  vhand process will takeout the pages which are not recently referenced and keep it in swap to create the page for new process

Pageout
  Taking the page from memory to swap by vhand

Page fault
            If process try to access the address hat is not there in the memory, page fault error will come

Type of swaps
1                    Primary swap
2                    Secondary swap
3                    Device swap
4                    File system swap

Primary swap 
   The swap which is using while booting the system .It wall be there in the root disk.
Secondary swap.
            The swap other than primary. Will be there in other disk. Will be device swap or fiesysem swap

Device swap
            The space which is created for swap only. That will be a full hdd in whole disk approach or a logical volume in lvm.

File system swap
            The part of the filesystem reserved for swap

Creating devicd swap

# newfs –R 200 /dev/rdsk/c0t1d0
             A whole disk approach it will create a swap with size of 200 Mb . .

# lvcreate –L 200 –name newswap /dev/vg01

# /usr/sbin/swapon /dev/dsk/c0t1d0
# /usr/sbin/swapon /dev/vg01/newfs
            use –f option to overwrite the old fle system
                   -e option to use the end of the disk.

# swapon –a to enable all the swap areas adde in /etc/fstab
Creating swap on a filesystem

# swapon –p 4 –l 12M /myfile
            will create a swap wih priority 4 and limit of 12mb in the filesystem which is mounted in /myfile.

/etc/fstab

            /dev/dsk/cot1d0                                  swap               defaults                       0 0
            /dev/vg01/newfs                                 swap               defaults                       0 0
                                                /myfile             swapfs                        pri=4 lim=12M           0 0

Information about swap

# swapifo –f               will show all filesystem swap
# swpinfo –d              will show device swap
# swapinfo –a             will show all swap
# swapinfo –tm          report total value in mb
# swapinfo –r             will show the reserved swap

Prioritizing of swap

Priority range        0-10
-p option
# swapon –p 2 /dev/vg02/lvol3

Default priority is 1