欢迎阅读!

潇湘夜雨

当前位置: 主页 > 系统 >

交换分区

时间:2016-09-08 11:33来源: 作者:华嵩阳 点击:
概述: Linux 中Swap(即: 交换分区 ),类似于Windows的 虚拟内存 ,就是当 内存不足 的时候,把一部分硬盘空间虚拟成内存使用,从而解决内存容量不足的情况。Android是基于Linux的操作系
概述:
    Linux中Swap(即:交换分区),类似于Windows的虚拟内存,就是当内存不足的时候,把一部分硬盘空间虚拟成内存使用,从而解决内存容量不足的情况。Android是基于Linux的操作系统,所以也可以使用Swap分区来提升系统运行效率
交换分区,英文的说法是swap,意思是“交换”、“实物交易”。它的功能就是在内存不够的情况下,操作系统先把内存中暂时不用的数据,存到硬盘的交换空间,腾出内存来让别的程序运行,和Windows的虚拟内存(pagefile.sys)的作用是一样的。
创建swap分区:
1.新建逻辑分区
[root@localhost ~]# fdisk /dev/sdb
 
Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (14-27, default 14): 
Using default value 14
Last cylinder or +size or +sizeM or +sizeK (14-27, default 27): +10M  
 
Command (m for help): p
 
Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          13      104391   83  Linux
/dev/sdb2              14          27      112455    5  Extended
/dev/sdb5              14          15       16033+  83  Linux
 
Command (m for help): t
Partition number (1-5): 5
Hex code (type L to list codes): 82
Changed system type of partition 5 to 82 (Linux swap / Solaris)
 
Command (m for help): p
 
Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          13      104391   83  Linux
/dev/sdb2              14          27      112455    5  Extended
/dev/sdb5              14          15       16033+  82  Linux swap / Solaris
 
2.格式化交换分区:[root@localhost ~]# mkswap /dev/sdb5
3.启用交互分区:[root@localhost ~]# swapon /dev/sdb5
(责任编辑:liangzh)
织梦二维码生成器
顶一下
(1)
100%
踩一下
(0)
0%
------分隔线----------------------------
发布者资料
华嵩阳 查看详细资料 发送留言 加为好友 用户等级:注册会员 注册时间:2016-09-08 11:09 最后登录:2017-04-25 19:04