2. mkswap "partition name"
3. Add below entry in fstab
/dev/sde1 none swap sw 0 0
4. swapon -a , to enable swap
5. swapon -s - to view swap
root@Microknoppix:~# fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders, total 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 1 2104514 1052257 82 Linux swap / Solaris
/dev/sda2 * 2104515 20964824 9430155 83 Linux
Disk /dev/sdb: 2147 MB, 2147483648 bytes
86 heads, 7 sectors/track, 6967 cylinders, total 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
# fdisk /dev/sde
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-2097151, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151):
Using default value 2097151
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 82 ===> Chnage the partition type to swap.
Changed system type of partition 1 to 82 (Linux swap / Solaris)
Command (m for help): p
Disk /dev/sde: 1073 MB, 1073741824 bytes
139 heads, 8 sectors/track, 1885 cylinders, total 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc1eb8e97
Device Boot Start End Blocks Id System
/dev/sde1 2048 2097151 1047552 82 Linux swap / Solaris
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
root@Microknoppix:~#
root@Microknoppix:~# partprobe
root@Microknoppix:~# mkswap /dev/sde1 -- > To setup linux swap area.
Setting up swapspace version 1, size = 1047548 KiB
no label, UUID=dbcac054-444e-4a1b-a809-c4a1ba001ee7
root@Microknoppix:~# grep /dev/sde1 /etc/fstab
/dev/sde1 none swap sw 0 0 ------------> Add in this to mount swap partition.
root@Microknoppix:~#
root@Microknoppix:~# swapon -a --------> Turn on swap partition.
root@Microknoppix:~# swapon -s --------> List swap partitions.
Filename Type Size Used Priority
/dev/sda1 partition 1052252 0 -1
/dev/sde1 partition 1047548 0 -2
Use the following command to see swap partitions.
root@Microknoppix:~# free -m
total used free shared buffers cached
Mem: 751 123 627 0 8 58
-/+ buffers/cache: 56 694
Swap: 2050 0 2050
root@Microknoppix:~# cat /proc/swaps
Filename Type Size Used Priority
/dev/sda1 partition 1052252 0 -1
/dev/sde1 partition 1047548 0 -2
root@Microknoppix:~#
http://www.thegeekstuff.com/2010/08/how-to-add-swap-space/
http://www.real-world-systems.com/docs/fstab.5.html