[CentOS] Re: LVM Resizing Problem

Sun May 6 15:14:50 UTC 2007
Ross S. W. Walker <rwalker at medallion.com>

> -----Original Message-----
> From: centos-bounces at centos.org 
> [mailto:centos-bounces at centos.org] On Behalf Of Scott Silva
> Sent: Friday, May 04, 2007 1:16 PM
> To: centos at centos.org
> Subject: [CentOS] Re: LVM Resizing Problem
> 
> Al Sparks spake the following on 5/2/2007 6:59 PM:
> > I'm new to lvm.  I decided to decrease the space of a 
> logical volume.
> > So I did a:
> >    $ df -m
> >    Filesystem           1M-blocks      Used Available Use% 
> Mounted on
> >    /dev/mapper/VolGroup00-LogVol00
> >                              1953       251      1602  14% /
> >    /dev/sda2                  494        21       448   5% /boot
> >    tmpfs                     1014         0      1014   0% /dev/shm
> >    /dev/mapper/VolGroup00-LogVol05
> >                             48481      6685     39295  15% /home
> >    /dev/mapper/VolGroup00-LogVol03
> >                               961        18       894   2% /tmp
> >    /dev/mapper/VolGroup00-LogVol01
> >                              7781      2051      5329  28% /usr
> >    /dev/mapper/VolGroup00-LogVol02
> >                              5239       327      4642   7% /var
> > 
> > 
> > 
> >     $ sudo lvm lvreduce -L -1000M /dev/VolGroup00/LogVol05
> >     Rounding up size to full physical extent 992.00 MB
> >     WARNING: Reducing active and open logical volume to 47.91 GB
> >     THIS MAY DESTROY YOUR DATA (filesystem etc.)
> >   Do you really want to reduce LogVol05? [y/n]: y
> >     Reducing logical volume LogVol05 to 47.91 GB
> >     Logical volume LogVol05 successfully resized
> LVM even warned you --IN CAPS-- "THIS MAY DESTROY YOUR DATA".
> I guess it was right. I haven't had much luck with reducing a 
> volume below its
> initial size. I usually make a new LV and rsync or cp -a the 
> data over to it.
>  I try to leave some free space just for this. Or add a drive 
> temporarily.

Were the LV calculations done in the VG's extent size unit?

Most people forget LVM rounds to the closest whole extent in it's
calculations which I believe is 4MB by default, so care must be
taken to make sure any file system fits comfortably in there
first.

-Ross

______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.