10:58 AM How to create swap file in Linux : Adding extra swap space |
To create SWAP space/file in your system, you just need to follow below simple steps. First we shall see how much free space we are having using free -k or swapon -s command.
Here swapon -s just looks into the file /proc/swaps.
Note: free -k shows free spaces in KB, free -m, displays in MB and free -g shows free spaces in system in GB.
Here, -if (input file) --> reads data from specified input file -of(output file) --> writes data to specified output file -bs(BYTES) -->read and write BYTES bytes at a time -count(BLOCKS) --> copy only BLOCKS input blocks
-f Force - go ahead even if the command is stupid. This allows the creation of a swap area larger than the file or partition it resides on. Without this option mkswap will refuse to erase the first block on a device with a partition table or on whole disk (e.g. /dec/sda).
/root/swapfile swap swap defaults 0 0
-a, --all
All devices marked as ``swap'' in /etc/fstab are made available, except for those with the ``noauto'' option. Devices that are already being used as swap are silently skipped.
|
|
Related blogs
You may also like to see:
[2014-09-21] | [Open System-Linux] |
How to define command prompt strings in Linux : what are $PS1, $PS2, $PS3 and $PS4? |
[2014-04-24] | [Open System-Linux] |
Addition of two numbers using shell scripting in UNIX |
[2016-03-17] | [Open System-Linux] |
Some amazing command shortcuts in Linux |
[2014-01-08] | [Open System-Linux] |
SSH Login Setup |
[2016-05-24] | [Open System-Linux] |
FACTER command in Linux : showing system facts |
Total comments: 0 | |