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-13] | [Open System-Linux] |
md5sum: calculate and check md5 message digest of a file in Linux |
[2014-04-10] | [Open System-Linux] |
SED command for filtering and transforming texts of a file using regular expression |
[2015-06-19] | [Open System-Linux] |
How to create swap file in Linux : Adding extra swap space |
[2014-10-04] | [Open System-Linux] |
SYSCTL : A command to configure kernel parameters at runtime in linux |
[2016-04-14] | [Open System-Linux] |
AT command in Linux : schedule a task at later time |
Total comments: 0 | |