How to create swap partition in Linux at command shell?
I want to create a swap partition at command shell. What are the different step to create it and how I can use this partition?
U may use hard disk partition for additional swap space. 1st see how much...
U may use hard disk partition for additional swap space. 1st see how much space it is used like free -k command. If u have an additional hard disk, (or space available in an existing disk), create a partition using fdisk command. Now setup newly created partition as swap area using the mkswap command like mkswap /dev/sdaX (here X is no of partition). To make this swap space partition available even after the reboot, add the following line to the /etc/fstab file like
# cat /etc/fstab
/dev/sdaX swap swap defaults 0 0
to verify run command as: swapon -s
But remember this is an expert area job, do at ur own risk. Better take bkup of ur necessary files/ folders.