Swap Filesystem Creation

Partition Creation for Swap filesystem
1. fdisk -l
2. fdisk /dev/sda
3. Type p & Press Enter
4. Type n & Press Enter
5. Just Press Enter for 1st Cylinder size
6. Type +sizeM for last Cylinder size
7. Type p & Press Enter
8. Type t & Press Enter
9. t2 /dev/sda12
10. Type 82 & Press Enter
11. Type p & Press Enter
12. Type w & Press Enter
13. partprobe
14. swapon -s
15. swapoff /dev/sda7 => Swapoff the another swap partition
16. swapon -s

Creation of a new Swap Filesystem
1. mkswap -v1 /dev/sda12
2. swapon /dev/sda12
3. swapon /dev/sda7
Here /dev/sda7 & /dev/sda12 are swap partition.

For automounting the either or swap partition do the following :

1. vi /etc/fstab
2. Add the following line :-

/dev/sda12 swap swap defaults 0 0

Note :- Partition Id identifies what type of filesystem will have to create. Id is Hexacode number. Maximum 4 partition can be create 3 primary & 1 Extended.

Filesystem ID
Ext2 / Ext3 ( Linux) 83
Swap 82
Fat32 C

Comments

Popular posts from this blog

How do I Use the Linux Top Command?

IOPS measurement