Centos 6.x XFS 数据盘扩容示例

XFS是一个开源的(GPL)日志文件系统,最初由由Silicon Graphics为他们的IRIX操作系统而开发,现在大多数的Linux发行版都支持。事实上,XFS已被最新的CentOS/RHEL 7采用,成为其默认的文件系统。在其众多的特性中,包含了“在线调整大小”这一特性,使得现存的XFS文件系统在已经挂载的情况下可以进行扩展。然而,对于XFS文件系统的缩减却还没有支持。

算了~实在写不出来高大上的风格,还是按照我自己的格式来吧

**提示:
务必做好快照备份!!!
务必做好快照备份!!!
务必做好快照备份!!!**

1,在ecs控制台进行磁盘扩容
image
2,设置容量,确认扩容
image
3,点击已阅读即可生效
image
4,看下云盘列表,操作的数据盘已经生效了
image
5,控制台重启(最好重启一下),然后登陆系统内部查看磁盘大小,可以看到磁盘大小已经有了,但是挂载信息还是旧的大小

fdisk -l && df -Th

image

6,关键步骤来了,xfs_growfs虽然可以直接调整大小,但是还有一个前提步骤的,如果不做的话,那么效果如下(实际没有扩容)

xfs_growfs /dev/xvdb1

image
7,要把已经扩容后的空间分配给xvdb1

fdisk /dev/xvdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/xvdb: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x78d35258

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1               1        3916    31455238+  83  Linux

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-6527, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-6527, default 6527): 
Using default value 6527

Command (m for help): p

Disk /dev/xvdb: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x78d35258

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1               1        6527    52428096   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

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)
Syncing disks.

注意:上面这个报错提示说明实际分区信息是没有写入进去,因为分区是挂载的,最好是umount的情况下进行重新分区,如果看到这个报,可以umount一下,然后fdisk /dev/xvdb w保存下信息
7,进行xfs扩容

xfs_growfs /dev/xvdb1

image

8,扩容成功

**提示:
务必做好快照备份!!!
务必做好快照备份!!!
务必做好快照备份!!!**

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值