cat resizing-an-ext3-filesystem-on-an-lvm.md
Resizing an ext3 filesystem on an lvm
Just a short reference:
Keep in mind: There is no longer a need to convert the filesystem to ext2 to resize it. resize2fs can handle ext3 just fine.
First, unmount the filesystem in question, unless you have and trust online resizing (I can't subscribe to either). Then check it for errors like this:
# e2fsck -f /dev/VolGroup00/LogVol00(replace the path with that of the device you just unmounted)
Get an overview of what you currently have allocated
# lvsSave said overview
# lvs > maybe_useful.txtResize a given filesystem to 50 gigs (read man lvreduce/lvextend to learn how to resize using relative sizes, like reducing the filesystem by 5 gigs)
# resize2fs -p /dev/VolGroup00/LogVol00 50GRun a new check on the filesystem, just to be sure it worked well
# e2fsck -f /dev/VolGroup00/LogVol00Resize the lvm partition to fit the filesystem (I usually go a bit higher than the filesystem, just to make sure there's room for it, then resize the filesystem again to fill the partition afterwards)
# lvreduce -L55G /dev/VolGroup00/LogVol00Expand the other partition to use the space you just freed up (this will use all available space. again, read manual for how to use only part of the space if you want to extend more lvm's to fit the space you just made available)
# lvextend /dev/VolGroup00/LogVol01 /dev/md1(md1 is the physical device I wish to fill)
Extend both filesystems to fit their partitions and check them both afterwards
# e2fsck -f /dev/VolGroup00/LogVol01
# resize2fs -p /dev/VolGroup00/LogVol00
# resize2fs -p /dev/VolGroup00/LogVol01
# e2fsck -f /dev/VolGroup00/LogVol00
# e2fsck -f /dev/VolGroup00/LogVol01Re-mount your filesystems, and hopefully everything went well :)
Comments