In earlier versions of RHEL4, The ext2online command was used to expand the logical volume online. In RHEL5, The ext2online command has been replaced by resize2fs. The following describes how to expand the logical volume online in RHEL5: 1. In this example, we use LVM. The first step is to assume that we have 5g air separation zone, in addition, the device Number of the partition is/dev/hdc32, and we create a 2 GB logical volume on this device # pvcreate/dev/
In earlier versions of RHEL4, The ext2online command was used to expand the logical volume online. In RHEL5, The ext2online command has been replaced by resize2fs. The following describes how to expand the logical volume online in RHEL5:
1 in this example, we use LVM. The first step is to assume that we have a 5g air separation zone and the device number of this partition is/dev/hdc3.
2. Create a 2 GB logical volume on the device.
# Pvcreate/dev/hdc3
# Vgcreate vg0/dev/hdc3
# Lvcreate-L 2G-n lv0 vg0
# Mkfs. ext3/dev/vg0/lv0
# Mkdir/mnt/test
# Mount/dev/vg0/lv0/mnt/test
3. After completing the preceding steps, run df-h to view the new partition information.
4. Now we can see that we have 2 GB of free partitions, and we still have 3 GB of free space on vg0. Next we will add 2 GB space to lv0.
# Lvextend-L + 2G/dev/vg0/lv0
5. Run the df-h command to check whether/mnt/test displays 2 GB of data. In order to expand the data to 4 GB online, run
# Resize2fs/dev/vg0/lv0
After 6,/mnt/test will be expanded to 4 GB.