精华内容
下载资源
问答
  • LVM 扩容

    2020-01-08 11:03:54
    LVM 扩容1,LVM 查看2,LVM 扩容 1,LVM 查看 逻辑卷lv # lvdisplay 物理卷卷组vg # vgdisplay 物理卷pv # pvdisplay 2,LVM 扩容 # lsblk 格式化新磁盘 # mkfs.ext4 /dev/sdc 新建物理卷PV # ...

    1,LVM 查看

    • 逻辑卷lv
    # lvdisplay
    
    • 物理卷卷组vg
    # vgdisplay
    
    • 物理卷pv
    # pvdisplay
    

    2,LVM 扩容

    # lsblk
    
    • 格式化新磁盘
    # mkfs.ext4 /dev/sdc
    
    • 新建物理卷PV
    # pvcreate /dev/sdc
    WARNING: ext4 signature detected on /dev/sdc at offset 1080. Wipe it? [y/n]: y
      Wiping ext4 signature on /dev/sdc.
      Physical volume "/dev/sdc" successfully created.
    
    • 查看物理卷
    # pvscan
      PV /dev/sdb   VG lvm_01          lvm2 [<7.28 TiB / <284.04 GiB free]
      PV /dev/sdc                      lvm2 [<7.28 TiB]
      Total: 2 [14.55 TiB] / in use: 1 [<7.28 TiB] / in no VG: 1 [<7.28 TiB]
    
    • 扩容物理卷卷组VG
    # vgdisplay
      --- Volume group ---
      VG Name               lvm_01
      System ID
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  2
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                1
      Open LV               1
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               <7.28 TiB
      PE Size               4.00 MiB
      Total PE              1907721
      Alloc PE / Size       1835008 / 7.00 TiB
      Free  PE / Size       72713 / <284.04 GiB
      VG UUID               ZhcL6C-EnJv-hG0Z-xK2j-Kcg9-6Wu3-QDhyZD
    
    # vgextend lvm_01 /dev/sdc
      Volume group "lvm_01" successfully extended
    
    • Free PE / Size 1980434 / 7.55 TiB 可以扩容的大小
    # vgdisplay
      --- Volume group ---
      VG Name               lvm_01
      System ID
      Format                lvm2
      Metadata Areas        2
      Metadata Sequence No  3
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                1
      Open LV               1
      Max PV                0
      Cur PV                2
      Act PV                2
      VG Size               14.55 TiB
      PE Size               4.00 MiB
      Total PE              3815442
      Alloc PE / Size       1835008 / 7.00 TiB
      Free  PE / Size       1980434 / 7.55 TiB
      VG UUID               ZhcL6C-EnJv-hG0Z-xK2j-Kcg9-6Wu3-QDhyZD
    
    # lvdisplay
      --- Logical volume ---
      LV Path                /dev/lvm_01/lv01
      LV Name                lv01
      VG Name                lvm_01
      LV UUID                8VfFgs-5mbK-YVyA-CkXc-IogB-Csov-u4TndV
      LV Write Access        read/write
      LV Creation host, time e5, 2019-12-02 15:46:49 +0800
      LV Status              available
      # open                 1
      LV Size                7.00 TiB
      Current LE             1835008
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           253:0
    
    • 按照百分比扩容
    # lvextend -l +100%FREE /dev/lvm_01/lv01
      Size of logical volume lvm_01/lv01 changed from 7.00 TiB (1835008 extents) to 14.55 TiB (3815442 extents).
      Logical volume lvm_01/lv01 successfully resized.
    
    • 刷新分区
    # df -Th
    dev/mapper/lvm_01-lv01 ext4      7.0T  4.3T  2.4T  65% /storage
    
    # resize2fs /dev/lvm_01/lv01
    resize2fs 1.44.1 (24-Mar-2018)
    Filesystem at /dev/lvm_01/lv01 is mounted on /storage; on-line resizing required
    old_desc_blocks = 896, new_desc_blocks = 1864
    +++++The filesystem on /dev/lvm_01/lv01 is now 3907012608 (4k) blocks long.
    
    # df -Th
    /dev/mapper/lvm_01-lv01 ext4       15T  4.3T  9.6T  31% /storage
    

    参考:

    1. LVM 配置
    2. Linux LVM 磁盘扩容
    展开全文
  • lvm扩容

    2021-09-02 15:06:55
    lvm扩容 [root@localhost ~]# df -h [root@localhost ~]# fdisk -l 虚拟机:添加虚拟磁盘,系统内刷新磁盘 (二)创建物理卷(PV) #pvcreate /dev/sdb 查看系统PV的情况: [root@localhost ~]# pvdisplay 查看原VG的...

    lvm扩容

    [root@localhost ~]# df -h

    [root@localhost ~]# fdisk -l

    虚拟机:添加虚拟磁盘,系统内刷新磁盘

    (二)创建物理卷(PV)
    #pvcreate /dev/sdb
    查看系统PV的情况:
    [root@localhost ~]# pvdisplay

    查看原VG的情况
    [root@localhost ~]# vgdisplay

    (三)#扩展卷组,将/dev/sdb物理卷添加到VolGroup卷组中
    [root@localhost ~]# vgextend VolGroup /dev/sdb

    (四)将新的VG空间划入LV(扩容lv_root)
    #直接扩展5G给/root分区,不用umount,也不需要重启
    #lvextend -L +5G /dev/mapper/VolGroup-lv_root
    也可以使用命令
    #lvextend -l +30%FREE /dev/mapper/VolGroup-lv_root

    此时,如果有df命令查看的话,会发现root空间并没有增加的.还需要执行以下两步操作才可以.

    #检查/root逻辑卷
    #e2fsck -f /dev/mapper/VolGroup-lv_root
    此命令报错

    解决方案:解挂载,再执行上命令
    在这里插入图片描述

    #重新定义分区大小
    #resize2fs /dev/mapper/VolGroup-lv_root

    展开全文
  • LVM扩容

    2020-03-19 23:28:28
    LVM扩容 分区基本结构 lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sr0 11:0 1 335.6M 0 rom vda 252:0 0 63G 0 disk ├─vda1 252:1 0 500M 0 part /boot └─v...

    LVM扩容

    1. 分区基本结构
    lsblk
    
    NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sr0           11:0    1 335.6M  0 rom  
    vda          252:0    0    63G  0 disk 
    ├─vda1       252:1    0   500M  0 part /boot
    └─vda2       252:2    0  61.5G  0 part 
      ├─xxx-root 253:0    0  57.6G  0 lvm  /
      └─xxx-swap 253:1    0   3.9G  0 lvm  [SWAP]
    vdb          252:16   0    20G  0 disk 
    └─vdb1       252:17   0    20G  0 part /path/of/mount
    
    1. parted /dev/vda
     (parted) print #打印分区信息,大概如下:
      Model: Virtio Block Device (virtblk)
      Disk /dev/vda: 67.6GB
      Sector size (logical/physical): 512B/512B
      Partition Table: msdos
      Disk Flags: 
     
      Number  Start   End     Size    Type     File system  标志
      1      1049kB  525MB   524MB   primary  ext4         启动
      2      525MB   66.6GB  66.0GB  primary               lvm
    
    (parted) resizepart 2 #调整想要调整的分区,2对应上面的Number值; 
                            #当出现提示结束点时,比如:结束点?  [64.4GB]? 
                            #此时默认的值是当前分区的大小,要扩大就要输入新的值
                            #该值一般就取print输出的Disk大小 (如:Disk /dev/vda: 67.6GB)
    
    (parted) quit         #退出parted
    
    1. partprobe

    2. pvresize /dev/vda2

    3. lvresize -l +100%FREE /dev/xxx/root

    4. resize2fs /dev/xxx/root

    展开全文
  • lvm 扩容

    2020-06-25 20:31:43
    #(1)剩余空间都扩容到根(/)目录 lvextend -l +100%FREE `df|grep -w '/'|awk '{print$1}'` #(2)扫描磁盘识别已扩容空间,磁盘为xfs文件系统,CentOS 7系统默认文件系统为XFS格式 xfs_growfs `df|grep -w '/'|awk...
    #查看剩余空间
    vgs
    #(1)剩余空间都扩容到根(/)目录
    lvextend -l +100%FREE  `df|grep -w '/'|awk '{print$1}'`
    #(2)扫描磁盘识别已扩容空间,磁盘为xfs文件系统,CentOS 7系统默认文件系统为XFS格式
    xfs_growfs `df|grep -w '/'|awk '{print$1}'` 
    --------------------------------------------------------------
    #只需替换grep -w '目录',例:剩余空间都扩容到/opt目录
    lvextend -l +100%FREE  `df|grep -w '/opt'|awk '{print$1}'`
    xfs_growfs `df|grep -w '/opt'|awk '{print$1}'`
    #扩容指定大小,例:扩容10g给根(/)目录
    lvextend -L +10g `df|grep -w '/'|awk '{print$1}'`
    xfs_growfs `df|grep -w '/opt'|awk '{print$1}'`
    #(2)扫描磁盘识别已扩容空间,磁盘格式为ext2\ext3\ext4文件系统需要执行以下命令,CentOS 6系统默认文件系统为EXT格式
    resize2fs `df|grep -w '/'|awk '{print$1}'`
    #查看文件系统是哪种格式
    df -T
    
    展开全文

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 9,600
精华内容 3,840
关键字:

lvm扩容