Sunday, 13 January 2013

how to create swap partition in linux 6

It is a file system type which is used to enhance of the system performence or it will act always

virtual memory.

#create one partition

#fdisk /dev/sda

press n - blank enter - +2G - p - press t -5 - for change the partition code give the 82 for swap id - p - w

#partx -a /dev/sda (press two time.)

#mkswap /dev/sda5 (to make swap)

#swapon /dev/sda5 (for activate the swap)

#swapon -s (show status of the swap)

#vim /etc/fstab

press i for insert mode and type this entry on last of line

/dev/sda5 swap swap defaults 0 0

press esc and

:wq! (save)

#mount -a (activate all mounts)

#free -m

#free -m -t

#cat /proc/swaps

#cat /proc/meminfo (all commands is use to check the swap status.)

No comments:

Post a Comment