Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
4.3.6. 由卷冊群組中移除實體卷冊
To remove unused physical volumes from a volume group, use the
vgreduce
command. The vgreduce
command shrinks a volume group's capacity by removing one or more empty physical volumes. This frees those physical volumes to be used in different volume groups or to be removed from the system.
在由一個卷冊群組中移除實體卷冊之前,您可藉由使用
pvdisplay
指令來確認實體卷冊並未被任何邏輯卷冊使用中。
# pvdisplay /dev/hda1
-- Physical volume ---
PV Name /dev/hda1
VG Name myvg
PV Size 1.95 GB / NOT usable 4 MB [LVM: 122 KB]
PV# 1
PV Status available
Allocatable yes (but full)
Cur LV 1
PE Size (KByte) 4096
Total PE 499
Free PE 0
Allocated PE 499
PV UUID Sd44tK-9IRw-SrMC-MOkn-76iP-iftz-OVSen7
若實體卷冊依然使用中,您便必須透過使用
pvmove
指令來將資料遷移至另一個實體卷冊上。然後使用 vgreduce
指令來移除掉實體卷冊:
下列指令會將實體卷冊
/dev/hda1
由 my_volume_group
卷冊群組中移除。
# vgreduce my_volume_group /dev/hda1