linux 扩容

参考https://help.aliyun.com/document_detail/25452.html?spm=a2c4g.11186623.6.768.3c3777ee5Z7duT

linux系统centos7,内核版本低于3.6

参考一下步骤:

使用fdisk命令删除旧分区。

  1. 运行fdisk -u /dev/vdb:分区数据盘。
  2. 输入p:打印分区表。
  3. 输入d:删除分区。
  4. 输入p:确认分区已删除。
  5. 输入w:保存修改并退出。

使用fdisk命令新建分区。

  1. 运行fdisk -u /dev/vdb:分区数据盘。
  2. 输入p:打印分区表。
  3. 输入n:新建分区。
  4. 输入p:选择分区类型为主分区。
  5. 输入<分区号>:选择分区号。本示例选取了1。

系统提示:WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)

按他的提示敲入命令

# partprobe /dev/xvdc
Error: Partition(s) 1 on /dev/xvdc have been written, but we have been unable to inform  the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.

提示重启,重启之后,扩容命令

# resize2fs /dev/xvdc1
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/xvdc1 is mounted on /home; on-line resizing required
old_desc_blocks = 4, new_desc_blocks = 8
The filesystem on /dev/xvdc1 is now 31457024 blocks long.
成功!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值