LVM逻辑卷的在线扩容

2018年11月26日11:22:50 发表评论 654 views

LVM逻辑卷的扩容

说明:前已经创建的vg卷组data(共2.18t),之前elk和MySQL各分了559G,data卷组剩余1.09t,现在我把他新建一个lvm命名为backup,然后格式化在挂载到/data下
[root@k8s-master dev]# vgs  
  VG     #PV #LV #SN Attr   VSize    VFree 
  centos   1   3   0 wz--n- <930.51g 99.06g
  data     1   2   0 wz--n-    2.18t  1.09t
新建lvm 命名为backup
[root@k8s-master dev]# lvcreate -L 1.09T -n backup data   
  Rounding up size to full physical extent 1.09 TiB
  Logical volume "backup" created.
[root@k8s-master dev]# vgs
  VG     #PV #LV #SN Attr   VSize    VFree  
  centos   1   3   0 wz--n- <930.51g  99.06g
  data     1   3   0 wz--n-    2.18t 416.00m
[root@k8s-master dev]# lvs
  LV     VG     Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home   centos -wi-ao----  700.00g                                                    
  root   centos -wi-ao----  100.00g                                                    
  swap   centos -wi-ao----  <31.45g                                                    
  backup data   -wi-a-----    1.09t                                                    
  elk    data   -wi-ao---- <558.28g                                                    
  mysql  data   -wi-ao---- <558.28g   
格式化,指定xfs格式 (慎重操作,操作前请再三确认分区表)
[root@k8s-master dev]# mkfs -t xfs /dev/mapper/data-backup  
meta-data=/dev/mapper/data-backup isize=512    agcount=4, agsize=73148672 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=292594688, imaxpct=5
         =                       sunit=0      swidth=0 blks
  ming   =version 2              bsize=4096   ascii-ci=0 ftype=1
▽og      =internal log           bsize=4096   blocks=142868, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
创建挂载点并挂载
[root@k8s-master dev]# mkdir /data 
[root@k8s-master dev]# mount /dev/mapper/data-backup /data/   
检验刚才新挂载的数据盘
[root@k8s-master dev]# df -h 
文件系统                 容量  已用  可用 已用% 挂载点
/dev/mapper/centos-root  100G   31G   70G   31% /
devtmpfs                  32G     0   32G    0% /dev
tmpfs                     32G     0   32G    0% /dev/shm
tmpfs                     32G  250M   32G    1% /run
tmpfs                     32G     0   32G    0% /sys/fs/cgroup
/dev/sda1                497M  160M  338M   33% /boot
/dev/mapper/data-mysql   559G   59G  500G   11% /var/lib/mysqldata
/dev/mapper/centos-home  700G   50G  650G    8% /home
/dev/mapper/data-elk     559G  276G  283G   50% /elk
tmpfs                    6.3G     0  6.3G    0% /run/user/1000
tmpfs                    6.3G     0  6.3G    0% /run/user/0
/dev/dm-6                 10G  211M  9.8G    3% /var/lib/docker/devicemapper/mnt/211dcaa002bd2a7f89ccaa913086668fd24ca70c298a3f425435d2209f805130
shm                       64M     0   64M    0% /var/lib/docker/containers/e16e9a692c50385f88dfb7523fa47a01688e6680f6632e4f9cdf6065f013c094/mounts/shm
/dev/mapper/data-backup  1.1T   33M  1.1T    1% /data
查看UUID并写入开机自挂载
[root@k8s-master dev]# blkid | grep /dev/mapper/data-backup  #查看UUID
/dev/mapper/data-backup: UUID="15de74f1-946a-4d41-93c0-b2afdeb57b59" TYPE="xfs" 
[root@k8s-master dev]# vim /etc/fstab
UUID="15de74f1-946a-4d41-93c0-b2afdeb57b59" /data       xfs     defaults        0 0 
  • 我的微信
  • 微信扫一扫
  • weinxin
  • 微信打赏一下咯
  • 一分钱也是爱
  • weinxin
广告也精彩
暖先生
Edifier/漫步者 W830BT 无线蓝牙耳机
DJI大疆 御 Mavic Air 便携可折叠4K无人机 高清航拍
Canon/佳能 EOS 750D 套机EF-S 18-55mm IS STM
VR眼镜3D虚拟现实头戴式游戏头盔rv眼睛4d手机专用ar苹果一体机

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: