【问题标题】:Add unallocated free space to LVM将未分配的可用空间添加到 LVM
【发布时间】:2016-08-17 20:39:14
【问题描述】:

我在 VMware 下向主磁盘添加了 5 GB。我可以看到 5GB 可用空间:

Number  Start   End     Size    Type      File system  Flags
    32.3kB  1049kB  1016kB            Free Space
 1      1049kB  256MB   255MB   primary   ext2         boot
        256MB   257MB   1048kB            Free Space
 2      257MB   215GB   214GB   extended
 5      257MB   215GB   214GB   logical                lvm
        215GB   220GB   5370MB            Free Space

如何将此可用空间添加到我的组卷?我需要先创建一个新分区吗?

【问题讨论】:

    标签: vmware lvm


    【解决方案1】:

    是的,您需要先创建一个分区,然后为 LVM 更改分区的系统 ID(代码 8e)。

    例子:

    fdisk /dev/sdb #Assuming this is the disk you added
    press "n" #to create a new partition and following along.
    press "t" #change the partition's system id to "8e"
    press "w" #to write the changes
    
    #Create PV.
    pvcreate /dev/sdb1
    #Add PV to the Volume Group
    vgextend <VolumeGroup> /dev/sdb1
    #Extend the logical volume
    lvextend -l +100%FREE /dev/VolumeGroup/yourLV
    

    确保扩展时未安装 LV。运行“lvdisplay”以确保逻辑卷扩展。

    注意:如果文件系统没有扩展,您可以尝试重新启动机器或执行 fsck 然后调整大小。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-29
      • 2019-03-21
      • 1970-01-01
      • 2022-11-24
      • 2011-04-26
      • 2022-07-04
      相关资源
      最近更新 更多