The swap partition frees up some of the space in the hard disk space when the system's physical memory is not available for use by the currently running program. The freed space may come from programs that have not been manipulated for a long time, and the freed space is temporarily saved to the swap partition until those programs are run and the saved data is restored to memory from the swap partition.
Let's do a little experiment to demonstrate how to create a swap partition and make it effective
First use FDISK/DEV/SDB to add a partition
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/86/83/wKiom1fBmR-inkA6AAB-VYngJsY675.png-wh_500x0-wm_3 -wmp_4-s_1510764271.png "style=" Float:none; "title=" 1 Create a disk partition. png "alt=" wkiom1fbmr-inka6aab-vyngjsy675.png-wh_50 "/ >
After adding the partition sdb1 you also need to modify the ID of the SDB1 system to
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/86/83/wKioL1fBmSDjc_4oAABSv8qB9kw975.png-wh_500x0-wm_3 -wmp_4-s_2371872029.png "style=" Float:none; "title=" 2 modify the partition ID to swap.png "alt=" Wkiol1fbmsdjc_4oaabsv8qb9kw975.png-wh_ "/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/86/83/wKiom1fBmSDBnLiMAAAkv40niZw424.png-wh_500x0-wm_3 -wmp_4-s_1767893390.png "style=" Float:none; "title=" 3 Save to exit. png "alt=" wkiom1fbmsdbnlimaaakv40nizw424.png-wh_50 "/ >
To see if the creation was successful
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/86/83/wKioL1fBmSGRYBgbAAAKbngaIEg086.png-wh_500x0-wm_3 -wmp_4-s_1231897724.png "style=" Float:none; "title=" 4 to see if the creation was successful. png "alt=" WKIOL1FBMSGRYBGBAAAKBNGAIEG086.PNG-WH_50 " />
mkswap-l swap_sdb1/dev/sdb1 to format the previously added/DEV/SDB1 partition as SWAP type 650) this.width=650; src= http://s3.51cto.com/ Wyfs02/m00/86/83/wkiol1fbmsljuzxwaabwkza8z9a531.png-wh_500x0-wm_3-wmp_4-s_2845040926.png "style=" Float:none; " Title= "5 formatted as a swap partition and view. png" alt= "wkiol1fbmsljuzxwaabwkza8z9a531.png-wh_50"/>
swapon-a/dev/sdb1 activating swap partition
Swapon-s view the currently active swap partition
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/86/83/wKiom1fBmSLTlyOsAAAhYVwqcDg338.png-wh_500x0-wm_3 -wmp_4-s_823677176.png "style=" Float:none; "title=" 6 enable swap partition. png "alt=" wkiom1fbmsltlyosaaahyvwqcdg338.png-wh_50 "/ >
In order to automatically mount the boot, we need to modify the/etc/fstab configuration file
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/86/83/wKiom1fBmSOjvCx_AABk4UFkhiM093.png-wh_500x0-wm_3 -wmp_4-s_2617594504.png "style=" Float:none; "title=" 7 write Fstab file Default boot. png "alt=" wkiom1fbmsojvcx_ Aabk4ufkhim093.png-wh_50 "/>
swapoff/dev/sdb1 Disabling/DEV/SDB1
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/86/83/wKioL1fBmSPDRcPUAABKUY0ujvA720.png-wh_500x0-wm_3 -wmp_4-s_2983647446.png "style=" Float:none; "title=" 8 viewing effect. png "alt=" wkiol1fbmspdrcpuaabkuy0ujva720.png-wh_50 "/ >
This article is from the "11798474" blog, please be sure to keep this source http://11808474.blog.51cto.com/11798474/1843427
Swap partition created under Linux system