磁盘扩容实例

实例1 剩余空间挂到/data
[2020-12-03_15:48:34] df -Th
[2020-12-03_15:48:40] lsblk -f
[2020-12-03_15:48:40] lsblk /dev/sda
[2020-12-03_15:48:50] vgextend vg01 /dev/vdb
[2020-12-03_15:48:53] lvscan
[2020-12-03_15:48:54] vgscan
[2020-12-03_15:48:56] pvscan
[2020-12-03_15:49:17] lvcreate -L 1T -n data vg01
[2020-12-03_15:49:24] lvscan
[2020-12-03_15:49:32] mkfs.xfs /dev/vg01/data
[2020-12-03_15:49:47] mkdir /data
[2020-12-03_15:49:58] ll /dev/mapper/vg01-data
[2020-12-03_15:49:59] blkid #查询UUID
[2020-12-03_15:50:05] vim /etc/fstab
[2020-12-03_15:50:33] mount -a
[2020-12-03_15:50:35] df -Th

实例2 LVM 扩容 /dev/centos/root
[root@node1 ~]# pvcreate /dev/sda3
[root@node1 ~]# vgextend centos /dev/sda3
[root@node1 ~]# lvextend -L +390G /dev/centos-root
  Size of logical volume centos/root changed from <44.00 GiB (11263 extents) to <434.00 GiB (111103 extents).
  Logical volume centos/root successfully resized.
[root@node1 ~]# xfs_growfs /dev/mapper/centos-root
meta-data=/dev/mapper/centos-root isize=512    agcount=4, agsize=2883328 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=11533312, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=5631, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 11533312 to 113769472

[root@node1 ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root  434G   43G  392G   10% /
devtmpfs                 7.8G     0  7.8G    0% /dev
tmpfs                    7.8G  866M  7.0G   11% /run
tmpfs                    7.8G     0  7.8G    0% /sys/fs/cgroup
tmpfs                    1.6G   12K  1.6G    1% /run/user/42

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值