[CentOS] LVM Resizing Problem

Fri May 4 01:39:58 UTC 2007
Al Sparks <data345 at yahoo.com>

--- Matt Hyclak <hyclak at math.ohiou.edu> wrote:

> On Wed, May 02, 2007 at 11:06:31PM -0700, Al Sparks enlightened us:
> > > Did you resize the filesystem, too?
> > > 
> > > Matt
> > 
> > Nope.  How do you do that?
> 
> resize2fs would be a good guess. Usually this is done *before* you shrink
> the disk out from underneath it. If anything was in those sectors you
> removed from the LV, you might be out of luck. 
> 
> Matt

Well, I was able to get my server back up.

First, I had to boot it up on a recovery CD (standard CentOS) and
comment out the bad volume it wanted to mount in /etc/fstab.

When the server came back up, I tried using resize2fs to resize.  The
resize2fs would not let me resize until I manually ran fsck because
the file system and logical volume block counts wouldn't match (been
there, done that, no joy).  So I increased the logical volume back to
where it was to make them match, ran fsck again, and everything
checked out.  I then was able to use resize2fs to decrease the file
system size, and then run lvreduce to decrease the volume size.

However, because neither application didn't seem to allow me to use
block size parameters, I used units of Megabytes and would end up
within a few blocks of each other.  I then would estimate how much
more units of +/- MB I needed to get things in sync.

Kind of a pain.  Anyway, I appreciate the help.  Nice to have these
tools available to use.
   === Al