How to extend a logical volume and its filesystem online in Red Hat Enterprise Linux?
Problem
What is the procedure to grow an existing filesystem based on logical volume?
How can I extend my logical volume and the filesystem in the command line?
I have extended a logical volume using lvextend which shows the extension in volume group vgdisplay but DF isn't reflecting the size, am I missing something?
How do I grow an ext3/ext4 filesystem on LVM?
How do I increase my filesystem on fly, without unmounting the filesystem?
We are using LVM for mounting the filesystem, how can we use the lvextend to extend the volume group and resize the filesystem?
What are the steps to extend a filesystem after a lun capacity has been extended?
What is the procedure to increase the size of an lvm2 logical volume and resize its filesystem?
I need to expand a filesystem created on LVM partition, is the filesystem need to be unmounted when expanding it or can I resize it online?
Resolution
Note:Red Hat recommends that all critical data be backed up and verified before making any changes to the underlying storage as an unforeseen problem might occur.
1. Create a physical volume from a free disk or partition (e.g./dev/sdc1
As a partition)
# pvcreate /dev/sdc1
2. Extend the volume group (/dev/sdc1
Is an existing physical volume path ).
# vgextend vgdata /dev/sdc1
3. Extend the logical volume (/dev/vgdata/lvdata
Is the existing logical volume path), which will be extended in 125 GB.
# lvextend -L +125G /dev/vgdata/lvdata
4. Extend an ext2/3 filesystem on the logical volume.
# resize2fs /dev/vgdata/lvdata
If the filesystem is ext4 with Red Hat Enterprise Linux 5, useresize4fs
Command instead ofresize2fs
Command.
5. If the filesystem is a GFS extend, see "How do I grow a gfs2 file-system on rhel5? ".
For more details, refer the tech brief how to increase the size of an lvm2 logical volume which walks through an example in which unpartitioned disk space is added to an existing volume group in order to extend a logical volume and corresponding file system, while they are active.
This article is from the "shenwei new space" blog, please be sure to keep this source http://abool.blog.51cto.com/8355508/1559653
How to expand the existing NFS storage capacity