使用实体分区创建SWAP
来源:互联网 发布:软件著作权资助 编辑:程序博客网 时间:2024/06/08 13:34
先进行分区的行为
[root@study ~]# gdisk /dev/vda
Command (? for help): n
Partition number (6-128, default 6):
First sector (34-83886046, default = 69220352) or {+-}size{KMGTP}:
Last sector (69220352-83886046, default = 83886046) or {+-}size{KMGTP}: +512M
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 8200
Changed type of partition to 'Linux swap'
Command (? for help): p
Number Start (sector) End (sector) Size Code Name
6 69220352 70268927 512.0 MiB 8200 Linux swap # 重点就是产生这东西!
Command (? for help): w
Do you want to proceed? (Y/N): y
[root@study ~]# partprobe
[root@study ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 40G 0 disk
.....(中间省略).....
`-vda6 252:6 0 512M 0 part
开始创建 swap 格式
[root@study ~]# mkswap /dev/vda6
Setting up swapspace version 1, size = 524284 KiB
no label, UUID=6b17e4ab-9bf9-43d6-88a0-73ab47855f9d
[root@study ~]# blkid /dev/vda6
/dev/vda6: UUID="6b17e4ab-9bf9-43d6-88a0-73ab47855f9d" TYPE="swap"
# 确定格式化成功!且使用 blkid 确实可以抓到这个设备!
开始观察与载入看看
[root@study ~]# free
total used free shared buff/cache available
Mem: 1275140 227244 330124 7804 717772 875536 # 实体内存
Swap: 1048572 101340 947232 # swap 相关
# 我有 1275140K 的实体内存,使用 227244K 剩余 330124K ,使用掉的内存有
# 717772K 用在缓冲/高速缓存的用途中。至于 swap 已经有 1048572K 啰!这样会看了吧?!
[root@study ~]# swapon /dev/vda6
[root@study ~]# free
total used free shared buff/cache available
Mem: 1275140 227940 329256 7804 717944 874752
Swap: 1572856 101260 1471596 <==有看到增加了没?
[root@study ~]# swapon -s
Filename Type Size Used Priority
/dev/dm-1 partition 1048572 101260 -1
/dev/vda6 partition 524284 0 -2
# 上面列出目前使用的 swap 设备有哪些的意思!
[root@study ~]# nano /etc/fstab
UUID="6b17e4ab-9bf9-43d6-88a0-73ab47855f9d" swap swap defaults 0 0
# 当然要写入配置文件,只不过不是文件系统,所以没有挂载点!第二个字段写入 swap 即可。
- 使用实体分区创建SWAP
- 在别的分区上创建SWAP分区,激活并使用
- Linux 创建SWAP分区
- ubuntu创建swap分区
- linux 创建swap分区
- 创建swap分区
- 创建swap分区
- SWAP分区创建脚本
- Linux使用swap分区
- Linux 使用swap分区
- 创建swap分区 并开启Swap
- linux怎么创建swap分区
- 为LINUX创建SWAP分区
- 手动创建Linux Swap分区
- 创建swap分区的脚本
- linux创建swap交换分区
- Linux创建swap分区(用文件作为Swap分区)
- linux硬盘格式化和创建swap分区
- PAT甲级1003. Emergency (25)
- IOS开发学习笔记(二)
- 【Android 进阶】 Android 回调理解
- 斜率优化总结
- Codeforces ZeptoLab Code Rush 2015 B. Om Nom and Dark Park DFS
- 使用实体分区创建SWAP
- 实验1:Visual C++6.0 开发环境入门
- 109. Convert Sorted List to Binary Search Tree
- 深入学习的艺术——每一个程序员都必不可少的技能
- Latex配置问题
- 九度OJ(1078)
- 外挂学习之路(10)--- 穿透发包线程寻找call的通杀方法
- 蓝桥杯 算法提高 聪明的美食家
- pat甲 1023. Have Fun with Numbers(模拟+set)