磁盘无法扩容 虚拟机centos_centos7.5虚拟机磁盘扩容详细步骤

1.关闭虚拟机,然后Vmware添加磁盘100G,然后开机。

2.fdisk –l

[root@server182 ~]# fdisk -l

Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 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/sda: 107.4 GB, 107374182400 bytes, 209715200 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 label type: dos

Disk identifier: 0x000b5b8a

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *        2048     2099199     1048576   83  Linux

/dev/sda2         2099200   209715199   103808000   8e  Linux LVM

Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 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: 2147 MB, 2147483648 bytes, 4194304 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: 50.5 GB, 50457477120 bytes, 98549760 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

4,可以看到添加的磁盘为/dev/sdb: 107.4 GB

5. [root@server182 ~]# pvcreate /dev/sdb

Physical volume "/dev/sdb" successfully created.

6.[root@server182 ~]# vgs

VG     #PV #LV #SN Attr   VSize   VFree

centos   1   3   0 wz--n- <99.00g 4.00m

7. [root@server182 ~]# vgextend  centos /dev/sdb

Volume group "centos" successfully extended

8.[root@server182 ~]# lvextend -L +50G /dev/mapper/centos-root

Size of logical volume centos/root changed from 50.00 GiB (12800 extents) to 100.00 GiB (25600 extents).

Logical volume centos/root successfully resized.

9.[root@server182 ~]# xfs_growfs /dev/mapper/centos-root

meta-data=/dev/mapper/centos-root isize=512    agcount=4, agsize=3276800 blks

=                       sectsz=512   attr=2, projid32bit=1

=                       crc=1        finobt=0 spinodes=0

data     =                       bsize=4096   blocks=13107200, imaxpct=25

=                       sunit=0      swidth=0 blks

naming   =version 2              bsize=4096   ascii-ci=0 ftype=1

log      =internal               bsize=4096   blocks=6400, version=2

=                       sectsz=512   sunit=0 blks, lazy-count=1

realtime =none                   extsz=4096   blocks=0, rtextents=0

data blocks changed from 13107200 to 26214400

10 添加50G到 root成功!

[root@server182 ~]# lvs

LV   VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert

home centos -wi-ao----  96.99g

root centos -wi-ao---- 100.00g

swap centos -wi-ao----   2.00g

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值