11: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-03-13] | [Open System-Linux] |
crontab: A command in linux to automatically start/repeat a process at certian time and interval | |
| [2014-04-24] | [Open System-Linux] |
Addition of two numbers using shell scripting in UNIX | |
| [2014-10-17] | [Open System-Linux] |
| | |
| [2014-11-19] | [Open System-Linux] |
ETHTOOL : A tool in Linux to display or change ethernet card setting | |
| [2015-04-23] | [Open System-Linux] |
15 Great DATE command examples | |
| Total comments: 0 | |

crontab: A command in linux to automatically start/repeat a process at certian time and interval
Addition of two numbers using shell scripting in UNIX
ETHTOOL : A tool in Linux to display or change ethernet card setting
15 Great DATE command examples