Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to resize an LVM from 5000mb to 1000mb. It is currently using an ext3 filesystem. I need to be able to do this without losing any data that is on the partition.
Now after doing a bit of research I came across the example:
umount /home
e2fsadm −L−1G /dev/myvg/
mount /home
Now i know this will certainly work with an ext2 filesystem, but what about ext3?
Logical volumes may be resized dynamically while preserving the data on the volume, if the volume's filesystem supports resizing.
The e2fsadm command allows resizing of an ext2 or ext3 based logical volume. It is a front-end to utilities like lvextend, lvreduce, and resize2fs. ext2online can be used to grow mounted ext2/3 filesystems. Lvextend must be called first to grow the logical volume.
The following commands will grow the mounted /dev/vg0/data filesystem.
lvextend -L +500M /dev/vg0/data
ext2online /dev/vg0/data
e2fsadm -L -16M /dev/vg0/scratch (reduce /dev/vg0/scratch by 16 MB)
e2fsadm -L +128M /dev/vg0/data (extend /dev/vg0/data by 128 MB)
e2fsadm -l -8 /dev/vg0/data (reduce /dev/vg0/data by 8 extents)
For other filesystems, the lvextend utility can be used to add unallocated extents in the volume group to a logical volume. Then native utilities for the filesystem can be used to expand it to fill the volume. To reduce a filesystem, first the native utilities should be used to shrink the filesystem, then lvreduce should be used to shrink the logical volume.
lvm2 on rhel 4 does not have e2fsadm(it's obsolete).
[root@d400-image ~]# lvresize --resizefs -L 1M /dev/lvm-hdx/lvm0
/dev/cdrom: open failed: Read-only file system
Rounding up size to full physical extent 4.00 MB
fsadm: execlp failed: No such file or directory
fsadm failed: 2
Is there any solution in rhel 4 with NO e2fsadm but still want to shirnk the lv???
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.