如何配置 LVM 以使用整个分区

如何配置 LVM 以使用整个分区

由于空间紧张,/dev/sdb 上的 HDD 大小已从 500 GB 增加到 650 GB,但不确定如何调整 lvm 大小以利用可用的 150GB。

sdb         8:16   0   650G  0 disk
└─ceph--ef9893e6--7191--434e--a531--8deaeb51ad92-osd--data--5abbfff8--920a--419d--bb87--91ba4a1bf3a1
          253:0    0   500G  0 lvm

尝试了 lvextend 但失败了。

lvextend -L+12G /dev/ceph-ef9893e6-7191-434e-a531-8deaeb51ad92/osd-data-5abbfff8-920a-419d-bb87-91ba4a1bf3a1
  Insufficient free space: 3072 extents needed, but only 0 available

lvextend -l +100%FREE /dev/ceph-ef9893e6-7191-434e-a531-8deaeb51ad92/osd-data-5abbfff8-920a-419d-bb87-91ba4a1bf3a1
  New size (127999 extents) matches existing size (127999 extents).

lvdisplay
  --- Logical volume ---
  LV Path                /dev/ceph-ef9893e6-7191-434e-a531-8deaeb51ad92/osd-data-5abbfff8-920a-419d-bb87-91ba4a1bf3a1
  LV Name                osd-data-5abbfff8-920a-419d-bb87-91ba4a1bf3a1
  VG Name                ceph-ef9893e6-7191-434e-a531-8deaeb51ad92
  LV UUID                kzJ5pI-g1UI-CUdP-kZE7-wRqT-fwTd-cZeoAX
  LV Write Access        read/write
  LV Creation host, time 
  LV Status              available
  # open                 0
  LV Size                <500.00 GiB
  Current LE             127999
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0



 pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdb
  VG Name               ceph-ef9893e6-7191-434e-a531-8deaeb51ad92
  PV Size               500.00 GiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              127999
  Free PE               0
  Allocated PE          127999
  PV UUID               FzjGfa-evuO-cJxF-FcIo-u9Mb-wGuG-Pl4qFo

lvs

  LV                                            VG                                        Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  osd-data-5abbfff8-920a-419d-bb87-91ba4a1bf3a1 ceph-ef9893e6-7191-434e-a531-8deaeb51ad92 -wi-a----- <500.00g

操作系统 Ubuntu 20.04 LTS

相关内容