阿里云云盘扩展

阿里云云盘扩展—裸盘xfs 1. 备份并扩容云盘

登录阿里云控制台.备份需要扩展的云盘,并扩容

2. 操作系统扩容分区 2.1 用fidks确认磁盘性质

这里可以看到/dev/vdb1作为裸盘使用,且分区为1号

[root@bf-wmskw3-db ~]# fdisk -luDisk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x000dc50f Device Boot Start End Blocks Id System/dev/vda1 * 2048 2099199 1048576 83 Linux/dev/vda2 2099200 41943039 19921920 8e Linux LVMDisk /dev/vdb: 322.1 GB, 322122547200 bytes, 629145600 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x000e7aec Device Boot Start End Blocks Id System/dev/vdb1 2048 377473023 188735488 83 LinuxDisk /dev/mapper/centos-root: 18.2 GB, 18249416704 bytes, 35643392 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes 2.2 安装依赖工具 type growpart || yum install -y cloud-utils-growparttype sgdisk || yum install -y gdisk## 下面这行 vdb和1之间有空格LC_ALL=en_US.UTF-8 growpart /dev/vdb 1

执行效果如下

[root@xxx-xxxx-db ~]# LC_ALL=en_US.UTF-8 growpart /dev/vdb 1CHANGED: partition=1 start=2048 old: size=377470976 end=377473024 new: size=629143519 end=629145567 2.3 扩展分区

这里我们用df -Th确认了分区格式为xfs

# df -THFilesystem Type Size Used Avail Use% Mounted ondevtmpfs devtmpfs 8.2G 0 8.2G 0% /devtmpfs tmpfs 8.2G 0 8.2G 0% /dev/shmtmpfs tmpfs 8.2G 479M 7.7G 6% /runtmpfs tmpfs 8.2G 0 8.2G 0% /sys/fs/cgroup/dev/mapper/centos-root xfs 19G 6.8G 12G 38% //dev/vdb1 xfs 194G 141G 53G 73% /data/dev/vda1 xfs 1.1G 145M 919M 14% /boottmpfs tmpfs 1.7G 0 1.7G 0% /run/user/0

使用xfs_group命令进行扩容

# xfs_growfs /datameta-data=/dev/vdb1 isize=512 agcount=10, agsize=5242624 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0 spinodes=0data = bsize=4096 blocks=47183872, imaxpct=25 = sunit=0 swidth=0 blksnaming =version 2 bsize=4096 ascii-ci=0 ftype=1log =internal bsize=4096 blocks=10239, version=2 = sectsz=512 sunit=0 blks, lazy-count=1realtime =none extsz=4096 blocks=0, rtextents=0data blocks changed from 47183872 to 78642939

再次查看分区/data已经完成扩展

# df -THFilesystem Type Size Used Avail Use% Mounted ondevtmpfs devtmpfs 8.2G 0 8.2G 0% /devtmpfs tmpfs 8.2G 0 8.2G 0% /dev/shmtmpfs tmpfs 8.2G 479M 7.7G 6% /runtmpfs tmpfs 8.2G 0 8.2G 0% /sys/fs/cgroup/dev/mapper/centos-root xfs 19G 6.8G 12G 38% //dev/vdb1 xfs 323G 141G 182G 44% /data/dev/vda1 xfs 1.1G 145M 919M 14% /boottmpfs tmpfs 1.7G 0 1.7G 0% /run/user/0

比丘资源网 » 阿里云云盘扩展

发表回复

提供最优质的资源集合

立即查看 了解详情