XFS是一个开源的(GPL)日志文件系统,最初由由Silicon Graphics为他们的IRIX操作系统而开发,现在大多数的Linux发行版都支持。事实上,XFS已被最新的CentOS/RHEL 7采用,成为其默认的文件系统。在其众多的特性中,包含了“在线调整大小”这一特性,使得现存的XFS文件系统在已经挂载的情况下可以进行扩展。然而,对于XFS文件系统的缩减却还没有支持。
算了~实在写不出来高大上的风格,还是按照我自己的格式来吧
**提示:
务必做好快照备份!!!
务必做好快照备份!!!
务必做好快照备份!!!**
1,在ecs控制台进行磁盘扩容
2,设置容量,确认扩容
3,点击已阅读即可生效
4,看下云盘列表,操作的数据盘已经生效了
5,控制台重启(最好重启一下),然后登陆系统内部查看磁盘大小,可以看到磁盘大小已经有了,但是挂载信息还是旧的大小
fdisk -l && df -Th
6,关键步骤来了,xfs_growfs虽然可以直接调整大小,但是还有一个前提步骤的,如果不做的话,那么效果如下(实际没有扩容)
xfs_growfs /dev/xvdb1
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
8,扩容成功
**提示:
务必做好快照备份!!!
务必做好快照备份!!!
务必做好快照备份!!!**