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:
[2015-07-12] | [Open System-Linux] |
EGREP or extended grep in Linux to search patterns |
[2014-10-26] | [Open System-Linux] |
XMLLINT command in linux : a validating XML parser |
[2014-09-26] | [Open System-Linux] |
Traceroute command in Linux |
[2014-05-22] | [Open System-Linux] |
Archiving and compression of files in Linux |
[2014-02-19] | [Open System-Linux] |
Shift Key is not working!! Mapping keyboard keys from one to another |
Total comments: 0 | |