During RedHat usage, we often encounter the problem of hard disk space usage. Today, the server's hard disk space is used up to increase the hard disk space and add the existing space to the LVM. For details, see the internal document. 1. Collect related data and execute the following command: vgsVG # PV # LV # SNAttrVSizeVFre
During RedHat usage, we often encounter the problem of hard disk space usage. Today, the server's hard disk space is used up to increase the hard disk space and add the existing space to the LVM.
For details, see the internal document.
1. Collect relevant data
Run the following command:
Vgs
VG # PV # LV # SN Attr VSize VFree
VolGroup00 1 2 0 wz-n-49.88G 0
Lvs-a-o + devices
Lv vg Attr LSize Origin Snap % Move Log Copy % Convert Devices
LogVol00 VolGroup00-wi-ao 44.06G/dev/sda2 (0)
LogVol01 VolGroup00-wi-ao 5.81G/dev/sda2 (1410)
2. Basic configuration of the newly added Hard Disk
Run the following command:
Fdisk-l
Disk/dev/sdb: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065*512 = 8225280 byte
Fdisk/dev/sdb
Divide the hard disk into one partition. The result is as follows:
Device Boot Start End Blocks Id System
/Dev/sdb1 1 6527 52428096 83 Linux
3. LVM Configuration
Run the following command:
Vgextend VolGroup00/dev/sdb1 # Add sdb1 to VolGroup00
Lvextend-l + 100% FREE/dev/VolGroup00/LogVol00 # expand all FREE space
Resize2fs-f/dev/VolGroup00/LogVol00
4. Check
Run the following command:
Vgs
VG # PV # LV # SN Attr VSize VFree
VolGroup00 2 2 0 wz-n-99.84G 0
Lvs-a-o + devices
Lv vg Attr LSize Origin Snap % Move Log Copy % Convert Devices
LogVol00 VolGroup00-wi-ao 94.03G/dev/sda2 (0)
LogVol00 VolGroup00-wi-ao 94.03G/dev/sdb1 (0)
LogVol01 VolGroup00-wi-ao 5.81G/dev/sda2 (1410)
Df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/mapper/VolGroup00-LogVol00
92G 43G 44G 50%/
/Dev/sda1 99 M 13 M 82 M 14%/boot
Tmpfs 2.0G 0 2.0G 0%/dev/shm