所以我想扩展一个逻辑卷但遇到了一些错误。
lvextend 函数告诉我它无法分配空间,因为 pv 上没有可用空间,但是有。
这里我遗漏了什么吗?
sudo lvextend -L 80G /dev/mapper/ncvps--vg-data
Insufficient free space: 7680 extents needed, but only 0 available
sudo pvdisplay -m
--- Physical volume ---
PV Name /dev/mapper/sda5_crypt
VG Name ncvps-vg
PV Size 749.76 GiB / not usable 3.00 MiB
Allocatable NO
PE Size 4.00 MiB
Total PE 191937
Free PE 168913
Allocated PE 23024
PV UUID XOvj5D-ClTq-gfsw-F59L-aIqN-1tdt-OMGYrI
--- Physical Segments ---
Physical extent 0 to 7151:
Logical volume /dev/ncvps-vg/root
Logical extents 0 to 7151
Physical extent 7152 to 9199:
Logical volume /dev/ncvps-vg/swap_1
Logical extents 0 to 2047
Physical extent 9200 to 10223:
Logical volume /dev/ncvps-vg/home
Logical extents 0 to 1023
Physical extent 10224 to 23023:
Logical volume /dev/ncvps-vg/data
Logical extents 0 to 12799
Physical extent 23024 to 191936:
FREE
additional information:
sudo vgdisplay -vv
Setting activation/monitoring to 1
Setting global/locking_type to 1
Setting global/wait_for_locks to 1
File-based locking selected.
Setting global/prioritise_write_locks to 1
Setting global/locking_dir to /run/lock/lvm
Setting global/use_lvmlockd to 0
Setting response to OK
Setting token to filter:3239235440
Setting daemon_pid to 608
Setting response to OK
Setting global_disable to 0
Setting response to OK
Setting response to OK
Setting response to OK
Setting name to ncvps-vg
report/output_format not found in config: defaulting to basic
log/report_command_log not found in config: defaulting to 0
Processing VG ncvps-vg H0caAG-WH7t-SNWH-QxUg-4T2R-jW0F-fi6RW8
Locking /run/lock/lvm/V_ncvps-vg RB
Reading VG ncvps-vg H0caAGWH7tSNWHQxUg4T2RjW0Ffi6RW8
Setting response to OK
Setting response to OK
Setting response to OK
Setting name to ncvps-vg
Setting metadata/format to lvm2
Setting id to XOvj5D-ClTq-gfsw-F59L-aIqN-1tdt-OMGYrI
Setting format to lvm2
Setting device to 65024
Setting dev_size to 1572354048
Setting label_sector to 1
Setting ext_flags to 1
Setting ext_version to 2
Setting size to 1044480
Setting start to 4096
Setting ignore to 0
Setting response to OK
Setting response to OK
Setting response to OK
/dev/mapper/sda5_crypt: size is 1572356096 sectors
Process single VG ncvps-vg
--- Volume group ---
VG Name ncvps-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 12
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 749.75 GiB
PE Size 4.00 MiB
Total PE 191937
Alloc PE / Size 23024 / 89.94 GiB
Free PE / Size 168913 / 659.82 GiB
VG UUID H0caAG-WH7t-SNWH-QxUg-4T2R-jW0F-fi6RW8
Adding ncvps-vg/root to the list of LVs to be processed.
Adding ncvps-vg/swap_1 to the list of LVs to be processed.
Adding ncvps-vg/home to the list of LVs to be processed.
Adding ncvps-vg/data to the list of LVs to be processed.
Processing LV root in VG ncvps-vg.
--- Logical volume ---
global/lvdisplay_shows_full_device_path not found in config: defaulting to 0
LV Path /dev/ncvps-vg/root
LV Name root
VG Name ncvps-vg
LV UUID eNXazT-yprW-I2rq-K8hd-bGiy-e0Ur-XIBfEz
LV Write Access read/write
LV Creation host, time ncvps, 2018-12-13 23:51:02 +0100
LV Status available
# open 1
LV Size 27.94 GiB
Current LE 7152
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:1
Processing LV swap_1 in VG ncvps-vg.
--- Logical volume ---
global/lvdisplay_shows_full_device_path not found in config: defaulting to 0
LV Path /dev/ncvps-vg/swap_1
LV Name swap_1
VG Name ncvps-vg
LV UUID MKjhK4-vgMY-4ajM-twQV-fDs6-ApOl-Lifkjz
LV Write Access read/write
LV Creation host, time ncvps, 2018-12-13 23:51:02 +0100
LV Status available
# open 2
LV Size 8.00 GiB
Current LE 2048
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:2
Processing LV home in VG ncvps-vg.
--- Logical volume ---
global/lvdisplay_shows_full_device_path not found in config: defaulting to 0
LV Path /dev/ncvps-vg/home
LV Name home
VG Name ncvps-vg
LV UUID ybMqWA-0qcM-f6NI-oN7v-Ven9-fA3B-RSqtIn
LV Write Access read/write
LV Creation host, time ncvps, 2018-12-13 23:51:02 +0100
LV Status available
# open 1
LV Size 4.00 GiB
Current LE 1024
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:3
Processing LV data in VG ncvps-vg.
--- Logical volume ---
global/lvdisplay_shows_full_device_path not found in config: defaulting to 0
LV Path /dev/ncvps-vg/data
LV Name data
VG Name ncvps-vg
LV UUID TLqETm-cmUW-H40L-fUYr-evmF-VUDW-hLqIha
LV Write Access read/write
LV Creation host, time ncvps, 2018-12-14 22:25:15 +0100
LV Status available
# open 0
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:4
--- Physical volumes ---
PV Name /dev/mapper/sda5_crypt
PV UUID XOvj5D-ClTq-gfsw-F59L-aIqN-1tdt-OMGYrI
PV Status NOT allocatable
Total PE / Free PE 191937 / 168913
Unlocking /run/lock/lvm/V_ncvps-vg
Setting global/notify_dbus to 1
答案1
正如您所见,物理卷是不可分配的:
PV Status NOT allocatable
简单来说:
pvchange -x y /dev/mapper/sda5_crypt
它可以再次被分配。
我不知道事情是怎么变成这样的,也许有人可以评论一下这种情况通常是怎样发生的。