Redhat_Linux 添加一个swap分区

环境 Redhat 7.2 ,示例:
新添加一个swap分区
============要求:================================
swap 分区容量为 512 MiB

当您的系统启动时,swap 分区应该可以自动挂载

不要移除或者修改其他已经存在于您的系统中的 swap 分区
================================================
1、先查看一下目前系统中使用的swap分区,我的是只有一个,现在我要再添加个, 容量是512M的。。。

[root@desktop ~]# swapon -s
Filename                Type        Size    Used    Priority
/dev/sda2                               partition   2047996 0   -1

2、用分区工具重新划分一个容量为512M的分区,逻辑分区主分区都可以,推荐使用逻辑分区。。。

[root@desktop ~]# fdisk /dev/sda 
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p  -->看一下目前的分区状态

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000bffad

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    20482047    10240000   83  Linux
/dev/sda2        20482048    24578047     2048000   82  Linux swap / Solaris
/dev/sda3        24578048    25602047      512000   83  Linux

Command (m for help): n  -->使用n新建分区
Partition type:
   p   primary (3 primary, 0 ex
  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值