zoukankan      html  css  js  c++  java
  • LVM基础命令

    LVM基础命令
    
    
    1、常用的LVM部署命令
    功能/命令   物理卷管理    卷组管理      逻辑卷管理
    扫描        pvscan      vgscan       lvscan
    建立        pvcreate    vgcreate     lvcreate
    显示        pvdisplay   vgdisplay    lvdisplay
    删除        pvremove    vgremove     lvremove
    扩展        vgextend    lvextend
    缩小        vgreduce    lvreduce
    
    
    
    2、部署逻辑卷
    [root@db01 ~]# pvcreate /dev/sdb /dev/sdc
    [root@db01 ~]# vgcreate vg_tidb /dev/sdb /dev/sdc
    [root@db01 ~]# lvcreate -L 1024G -n lv_tidb vg_tidb
    [root@db01 ~]# mkfs.ext4 /dev/mapper/vg_tidb-lv_tidb
    [root@db01 ~]# mkdir -p /data/tidb-cluster
    [root@db01 ~]# echo "/dev/mapper/vg_tidb-lv_tidb  /data/tidb-cluster  ext4  defaults,nodelalloc,noatime  0 0" >> /etc/fstab
    [root@db01 ~]# mount -a
    [root@db01 ~]# df -h
    
    
    
    扩3、容逻辑卷
    [root@db01 ~]# umount /data/tidb-cluster
    [root@db01 ~]# lvextend -L 2048G /dev/mapper/vg_tidb-lv_tidb
    [root@db01 ~]# e2fsck -f /dev/storage/vo  #检查硬盘完整性,并重置硬盘容量。
    [root@db01 ~]# mount -a
    [root@db01 ~]# df -h
    
    
    
    4、缩小逻辑卷
    [root@db01 ~]# umount /data/tidb-cluster
    [root@db01 ~]# e2fsck -f /dev/mapper/vg_tidb-lv_tidb
    [root@db01 ~]# resize2fs /dev/mapper/vg_tidb-lv_tidb 500M
    [root@db01 ~]# mount -a
    [root@db01 ~]# df -h
    
    
    
    5、逻辑卷快照
    [root@db01 ~]# lvcreate -L 1024G -s -n SNAP /dev/mapper/vg_tidb-lv_tidb
    [root@db01 ~]# umount /data/tidb-cluster
    [root@db01 ~]# lvconvert --merge /dev/mapper/vg_tidb-lv_tidb-SNAP  #对逻辑卷进行快照还原
    [root@db01 ~]# mount -a
    [root@db01 ~]# ls /data/tidb-cluster/
    
    
    
    6、删除逻辑卷
    [root@db01 ~]# umount /data/tidb-cluster
    [root@db01 ~]# vim /etc/fstab
    删除 /dev/mapper/vg_tidb-lv_tidb  /data/tidb-cluster  ext4  defaults,nodelalloc,noatime  0 0
    [root@db01 ~]# lvremove /dev/mapper/vg_tidb-lv_tidb
    [root@db01 ~]# vgremove vg-tidb
    [root@db01 ~]# pvremove /dev/sdb /dev/sdc
  • 相关阅读:
    JS中的正则表达式
    JavaScript之作用域
    JS中var、let、const 的区别
    Windows 下JAVA 1.8的安装以及环境变量的配置
    [js] 获取文本域光标位置,插入文本
    Elastic Search 权重及排序搜索结果中 _score 字段为 null
    goland配置
    kafka topic CONSUMER命令操作
    PHP 在windows上安装kafka扩展(phpstudy)
    jquery 遍历选中值 对象中嵌套数组 ajax保存
  • 原文地址:https://www.cnblogs.com/zhouwanchun/p/13859452.html
Copyright © 2011-2022 走看看