我正在运行 Centos 6 服务器,它有 3 个物理卷。这些物理卷中的每一个都作为与其关联的卷组,并且这些卷组中的每一个都有与其关联的逻辑卷。
物理卷
--- Physical volume ---
PV Name /dev/xvdc
VG Name vg_applogs
PV Size 80.00 GiB / not usable 4.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 20479
Free PE 0
Allocated PE 20479
PV UUID cy7tNX-QwbJ-4ceZ-XKv1-VwSp-38S4-oLIeNF
--- Physical volume ---
PV Name /dev/xvdb
VG Name vg_app
PV Size 35.00 GiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 8959
Free PE 7679
Allocated PE 1280
PV UUID zbXMCG-Q49f-l1GI-3A7d-AL7m-CwZq-gawtS2
--- Physical volume ---
PV Name /dev/xvda2
VG Name VolGroup
PV Size 19.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 4994
Free PE 0
Allocated PE 4994
PV UUID rK3R1r-zw5i-Jk2v-IO3d-nsg8-UpkW-Kbt6Q2
卷组
--- Volume group ---
VG Name vg_applogs
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 80.00 GiB
PE Size 4.00 MiB
Total PE 20479
Alloc PE / Size 20479 / 80.00 GiB
Free PE / Size 0 / 0
VG UUID UlMQlU-pG3Y-sSDa-ZWnV-1ZqO-D9vG-3aeQTq
--- Volume group ---
VG Name vg_app
System ID
Format lvm2
Metadata Areas 1
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 1
Act PV 1
VG Size 35.00 GiB
PE Size 4.00 MiB
Total PE 8959
Alloc PE / Size 1280 / 5.00 GiB
Free PE / Size 7679 / 30.00 GiB
VG UUID Su9Uqv-eim1-bqXR-H5FJ-t0iq-pKq7-DpuAJw
--- Volume group ---
VG Name VolGroup
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 19.51 GiB
PE Size 4.00 MiB
Total PE 4994
Alloc PE / Size 4994 / 19.51 GiB
Free PE / Size 0 / 0
VG UUID cUsYpP-nKG3-r18W-rdcv-Cw3u-8eWh-KUfaFm
逻辑卷
--- Logical volume ---
LV Path /dev/vg_applogs/lv_applogs
LV Name lv_applogs
VG Name vg_applogs
LV UUID rcQVDe-vSMY-eUHy-VSZy-3453-nsCS-L7llXF
LV Write Access read/write
LV Creation host, time grdvla2100, 2017-05-09 19:34:35 +0100
LV Status available
# open 1
LV Size 80.00 GiB
Current LE 20479
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Path /dev/vg_app/lv_app
LV Name lv_app
VG Name vg_app
LV UUID rwze2a-DdK1-yUAw-JcCO-LStU-0S1m-C7AVKD
LV Write Access read/write
LV Creation host, time grdvla2100, 2017-05-09 19:24:15 +0100
LV Status available
# open 1
LV Size 5.00 GiB
Current LE 1280
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3
--- Logical volume ---
LV Path /dev/VolGroup/lv_root
LV Name lv_root
VG Name VolGroup
LV UUID 7QbtNM-bob5-KP3H-5GZe-ySuc-2q3c-GPj4DM
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-05-09 17:20:08 +0100
LV Status available
# open 1
LV Size 17.51 GiB
Current LE 4482
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
我希望利用可用的闲置容量物理体积 /dev/xvdb(卷组:VG_应用程序)并将其用于卷组 vg_applogs作为逻辑卷 lv_应用日志很快就被填满了。
延长期限的最佳方式是什么逻辑卷(lv_应用日志)/卷组(vg_applogs)并使用可用的备用容量卷组(VG_应用程序)?
PS:我认为 /dev/xvdb 目前没有任何分区表:
fdisk -l
Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00094f24
Device Boot Start End Blocks Id System
/dev/xvda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2 64 2611 20458496 8e Linux LVM
Disk /dev/xvdc: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/xvdd: 120 MB, 120254464 bytes
255 heads, 63 sectors/track, 14 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/xvdb: 37.6 GB, 37580963840 bytes
255 heads, 63 sectors/track, 4568 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_root: 18.8 GB, 18798870528 bytes
255 heads, 63 sectors/track, 2285 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_swap: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_applogs-lv_applogs: 85.9 GB, 85895151616 bytes
255 heads, 63 sectors/track, 10442 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_app-lv_app: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
答案1
简而言之,你不能。 LV 必须完全包含在单个 VG 中,不能让一个 LV 占用多个 VG 中的空间。