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-24] | [Open System-Linux] |
Set, unset, display shell behaviour options : SHOPT command in Linux |
[2015-01-18] | [Open System-Linux] |
The JAR archiving tool in Linux |
[2014-04-22] | [Open System-Linux] |
xmllint : a command line xml tool to view and find errors in XML file |
[2019-09-27] | [Open System-Linux] |
How to generate private/public key from PEM file With PuttyGen |
[2014-08-31] | [Open System-Linux] |
20 command line tools to check load and performance of a Linux System |
Total comments: 0 | |