尝试创建新的逻辑卷时出现“可用空间不足”错误?

尝试创建新的逻辑卷时出现“可用空间不足”错误?

我有一台使用 LVM 的专用服务器。我遵循 Ubuntu 文档中的指南,其中说明:

sudo lvcreate -L 10G -n lv_vm_ubuntu /dev/[VGNAME]

由于我的逻辑卷组名称是0,我尝试使用以下命令创建一个新的逻辑卷:

sudo lvcreate -L 20G -n lv_vm_ubuntu /dev/0

但输出了以下错误:

Volume group "0" has insufficient free space (0 extents): 5120 required.

这是有关我的磁盘的信息:

sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

输出:

NAME              FSTYPE              SIZE MOUNTPOINT LABEL
sda                                 223.6G            
└─sda1            LVM2_member       223.6G            
  ├─0-swap (dm-0) swap                7.5G [SWAP]     
  └─0-root (dm-1) ext4              216.1G /          
sdb                                 931.5G            
└─sdb1            linux_raid_member 931.5G            ubuntu:0
  └─md0           ext4              931.4G /mnt/md0   
sdc                                 931.5G            
└─sdc1            linux_raid_member 931.5G            ubuntu:0
  └─md0           ext4              931.4G /mnt/md0   

 

cat /etc/fstab

输出

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/0-root /               ext4    errors=remount-ro 0       1
# /mnt/md0 was on /dev/md0 during installation
UUID=bc5a499c-af64-467c-b9af-bc84af26e23c /mnt/md0        ext4    defaults        0       2
/dev/mapper/0-swap none            swap    sw              0       0

 

vgs

输出:

  VG   #PV #LV #SN Attr   VSize   VFree
  0      1   2   0 wz--n- 223.57g    0 

 

vgdisplay

输出:

  --- Volume group ---
  VG Name               0
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               223.57 GiB
  PE Size               4.00 MiB
  Total PE              57233
  Alloc PE / Size       57233 / 223.57 GiB
  Free  PE / Size       0 / 0   
  VG UUID               RC1AXq-ev6F-ll0T-6COG-9yPU-OaSV-hjeSKB

我做错了什么?

更新:

lvs

输出:

LV   VG   Attr      LSize   Pool Origin Data%  Move Log Copy%  Convert
root 0    -wi-ao--- 216.12g                                           
swap 0    -wi-ao---   7.45g  

答案1

您已将 VG 0 中的所有 PE 分配给逻辑卷。

查找lvs与 VG 0 关联的 LV,并找到要比较的 LV 大小。

相关内容