Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Extended use of the swap file swap space on Linux     - CentOS 7.0 Enable iptables firewall (Linux)

- Android Scroller call mechanism and the relationship of computeScroll (Programming)

- Oracle to start to solve the error ORA-27102 (Database)

- Joseph Central Java implementation (Programming)

- CentOS6 MongoDB connection solution can not break 1000 (Database)

- HBase Application Development Review and Summary of Series (Database)

- VirtualBox install Windows 8.1 has encountered an error 0x000000C4 solutions (Linux)

- Installation Atom text editor on Mint Ubuntu / Linux (Linux)

- To build Spring RestTemplate use HttpClient4 (Programming)

- 10 important Linux ps command combat (Linux)

- How to install Ubuntu strategy game Wesnoth 1.12.0 (Linux)

- Migu online music player for Linux (Linux)

- See how --nand flash timing diagram of a read operation Comments (Programming)

- Linux platform NTOP Installation and Configuration (Linux)

- Supervisor Installation and Configuration (Server)

- C language programming entry - Common operators (Programming)

- Struts2 Result Types (Programming)

- Detailed Linux su command to switch users Mistakes (Linux)

- To help you easily protect the Linux System (Linux)

- Sqoop data export import command (Database)

  Extended use of the swap file swap space on Linux
  Add Date : 2018-11-21      
  Imagine a scenario when our Linux system runs out of swap space, in this case, we want to use the swap partition extending swap space, but in some cases the disk has no free partitions available, and so that we not to extend it.
Therefore, in this case, we can use the swap file to increase swap space.
Here is the swap file extension swap space on Linux way
Let's first check the size of an existing swap space / partition, use the command 'free -m' or 'swapon -s'
My swap partition size is 2 GB, we will extend the swap space 1GB.
The first step: Use the following dd command to create a swap file size of 1GB
[Root @ linuxtechi ~] # dd if = / dev / zero of = / swap_file bs = 1G count = 1
1 + 0 records in
1 + 0 records out
1073741824 bytes (1.1 GB) copied, 414.898 s, 2.6 MB / s
[Root @ linuxtechi ~] #
You need to replace 'bs' and 'count' according to the size.
Step Two: Set the swap file permissions to 600
[Root @ linuxtechi ~] # chmod 600 / swap_file
Step 3: Open the file swap (swap_file)
Open swap with mkswap command
[Root @ linuxtechi ~] # mkswap / swap_file
Setting up swapspace version 1, size = 1048572KiB
no label, UUID = f7b3ae59-c09a-4dc2-ba4d-c02abb7db33b
[Root @ linuxtechi ~] #
Step 4: Adding swap file entry in fstab file
Add the following entry in the fstab file, so that interoperability can continue to use the swap file on every restart.
/ Swap_file swap swap defaults 00
Step 5: Use the command 'mkswap on' enable the swap file.
[Root @ linuxtechi ~] # swapon / swap_file
[Root @ linuxtechi ~] #
Step Six: Now you see swap space
Note: To avoid unexpected situation, as shown in the use swapoff command to turn it off, only when needed, using the steps shown in the swapon command to re-enable the swap file.
[Root @ linuxtechi ~] # swapoff / swap_file
[Root @ linuxtechi ~] #
- Using Vagrant to build multi-platform environment (Server)
- Quickly locate the mistakes by gdb location (Programming)
- Ten SCP transfer command example (Linux)
- Supervisor Installation and Configuration (Server)
- SA weak password security system of the security risks posed (Linux)
- Network traffic monitoring ntopng (Linux)
- Zabbix monitoring Oracle Database use Orabbix plug (Enhanced Edition) (Database)
- JBPM6 Tutorial - taught you how to install JBPM (Linux)
- jdbc Oracle database connection string writing pluggable (Database)
- ASM Disk Space Check (Database)
- Ubuntu 15.04 and Ubuntu 14.04 installed Cinnamon 2.6 (Linux)
- Ubuntu security settings and tools (Linux)
- Three kinds of binary tree traversal recursive and iterative solution (Programming)
- Elasticsearch 2.20 Beginners: aggregation (Server)
- Linux dynamic libraries and Guide (Programming)
- PostgreSQL Source Customization: Online global read only (Database)
- Configuring DNS process under CentOS 6.5 (Server)
- Package the Python script file into an executable file (Programming)
- Help you make Git Bisect (Linux)
- MySQL can not write the data keyword conflicts (Database)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.