RHEL5.4 is installed in Vmware, but the allocated disk is only 7 GB at the beginning. After various services are installed, the disk space is getting tighter. After the virtual machine is adjusted to a larger space, the additional space is allocated to the LVM volume group: 1. create a pv (physicalvolume) on/dev/sda3. Before adding a physical partition to the vg, initialize: # pvcrteate/dve/sda32. add pv (p) to the vg (volumegroup ).
RHEL 5.4 is installed in Vmware, but the allocated disk is only 7 GB. After various services are installed, the disk space is getting tighter. After the virtual machine is adjusted to a larger space, the additional space is allocated to the LVM volume group:
1. Create a pv (physical volume) on/dev/sda3. initialize the pv (physical volume) before adding the physical partition to the vg:
# Pvcrteate/dve/sda3
2. Add pv (physical volume) for vg (volume group ):
# Vgextend/dev/VolGoup00/dev/sda3
3. Add space for lv (logical volume)
# Lvextend-L + 7G/dev/VolGroup00/LogVol00
Note: before adding space for the lv, you must first adjust the vg size, that is, you must first increase the pv to the vg.
4. Adjust the ext3 partition size. The RHEL kernel supports extonline adjustment without uninstalling:
# Resize2fs/dev/VolGroup00/LogVol00
NOTE: For the/directory mounted to/dev/VolGroup00/LogVol00, to adjust the size of other directories, you only need to adjust the corresponding lv when executing lvextend.
5. view the current system partition size
[Roy @ rhel5 ~] $ Df-ah
File System capacity used available % mount point
/Dev/mapper/VolGroup00-LogVol00
13 Gb 4.4G 7.6G 37%/
Proc 0 0 0-/proc
Sysfs 0 0 0-/sys
Devpts 0 0 0-/dev/pts
/Dev/sda1 99 M 12 M 82 M 13%/boot
Tmpfs 506 M 0 506 M 0%/dev/shm
None 0 0 0-/proc/sys/fs/binfmt_misc
Sunrpc 0 0 0-/var/lib/nfs/rpc_pipefs