Thursday, December 31, 2009

SWAP PARTITIONS AND FILES IN REDHAT LINUX

SWAP PARTITIONS AND FILES

Features:

Extra, virtual RAM for the OS

Steps:
1. Identify current swap space

• swapon -s - enumerates partitions and/or files, which constitute swap storage

• free -m

2. Select target drive and provision swap partition

• fdisk /dev/sdb

• n

• 2

• 500

• +512 (cylinder 562) - 63 cylinders are required for 512MB

• t - change type

• 82 - Linux Swap/Solaris

• w - committ changes to disk

3. Create the swap file system on the raw partition: /dev/sdb2

• mkswap /dev/sdb2

4. Enable swapping - publish the swap space to the kernel

• swapon /dev/sdb2 - this enables swapping on /dev/sdb2

5. update /etc/fstab

• /dev/sdb2 swap swap defaults 0 0

6.swapoff /dev/sdb2 - disables swapping on /dev/sdb2

Task:

1. Improve system performance by distributing swapping to /dev/sdb2

• swapon /dev/sdb2

• swapoff /dev/sda6

• disable /dev/sda6 via /etc/fstab

No comments:

Post a Comment