fusioncompute8.0.1 centos7 一块磁盘扩容

1.扩容前先看下系统的/目录大小为43GB。

通过lsblk命令查看vda磁盘分了2个分区。


                                            fusioncompute8.0.1  centos7 一块磁盘扩容

2.在fusioncompute中,为其扩容10GB,总和就是下图显示ideology的90GB


                                            fusioncompute8.0.1  centos7 一块磁盘扩容


                                            fusioncompute8.0.1  centos7 一块磁盘扩容

3.通过fdisk -l看出来,/dev/vda增加了10GB,但是现在还不能用

[root@localhost ~]# fdisk -l

Disk /dev/vda: 96.6 GB, 96636764160 bytes, 188743680 sectors #注意这里由80GB升至96GB
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: 0x000b95b9

Device Boot Start End Blocks Id System
/dev/vda1 * 2048 2099199 1048576 83 Linux
/dev/vda2 2099200 167772159 82836480 8e Linux LVM

#注意这里总的扇区是188743680,现在只到了167772159.


Disk /dev/mapper/centos-root: 46.2 GB, 46166704128 bytes, 90169344 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 /dev/mapper/centos-swap: 17.2 GB, 17179869184 bytes, 33554432 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 /dev/mapper/centos-var: 10.7 GB, 10737418240 bytes, 20971520 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 /dev/mapper/centos-home: 10.7 GB, 10737418240 bytes, 20971520 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

[root@localhost ~]# fdisk /dev/vda
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): n
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p): p
Partition number (3,4, default 3): 3 #注意/dev/vda已经有2个分区了,所以这里选择分区编号为3,
First sector (167772160-188743679, default 167772160): #默认回车
Using default value 167772160
Last sector, +sectors or +size{K,M,G} (167772160-188743679, default 188743679): #默认回车
Using default value 188743679
Partition 3 of type Linux and of size 10 GiB is set

Command (m for help): t #将分区类型更改为8e(lvm)格式
Partition number (1-3, default 3):
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'

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.
[root@localhost ~]#

再次查看一下,


                                            fusioncompute8.0.1  centos7 一块磁盘扩容


                                            fusioncompute8.0.1  centos7 一块磁盘扩容


                                            fusioncompute8.0.1  centos7 一块磁盘扩容


                                            fusioncompute8.0.1  centos7 一块磁盘扩容


                                            fusioncompute8.0.1  centos7 一块磁盘扩容


                                            fusioncompute8.0.1  centos7 一块磁盘扩容


                                            fusioncompute8.0.1  centos7 一块磁盘扩容


                                            fusioncompute8.0.1  centos7 一块磁盘扩容

注意这里/分区用的是xfs格式,所以使用xfs_growfs调整分区


                                            fusioncompute8.0.1  centos7 一块磁盘扩容


                                            fusioncompute8.0.1  centos7 一块磁盘扩容