Linux :: Create Swap File

24 sec read

:: What is swap in linux
Swap in linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space.

 
:: How to create swap file in Linux
+ Create file (1GB) for add swap

dd if=/dev/zero of=/swapfile bs=1024 count=1048576

+ Make swap file

mkswap /swapfile

+ Change owner and permission

chown root.root /swapfile
chmod 0600 /swapfile

+ Enable swap file

swapon /swapfile

+ Checking

free -m

+ configure /etc/fstab to save configuration permanently

vi /etc/fstab
# add swap file configuration like this:
/swapfile swap swap defaults 0 0 

 
:: Link
+ Google
+ Cyberciti

How to fix problem with…

Facing a Git error with the 'vi' editor? Discover how to easily fix it by checking your Vim path and configuring Git to use...
Sysadmin.ID
10 sec read

Apache :: MP4 Streaming

Learn how to enable MP4 streaming in Apache with the installation of the mod_h264 streaming module, making your video content accessible and efficient. Follow...
Sysadmin.ID
18 sec read

Apache :: Flash / FLV…

Learn how to effortlessly configure Apache for FLV streaming by installing the mod_flvx module and updating your httpd.conf file. Discover the simple steps to...
Sysadmin.ID
15 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *