[linux-lvm] Moving space between logical volumes?

Chris Osicki Krzysztof.Osicki at swisscom.com
Fri Sep 2 08:36:21 UTC 2005


Howard

I've got more experience with growing filesystems as with reducing them. Never managed to 
delete enough data so a shring would make sense ;-)
Just yesterday I inncreased size of a ext3 FS by doing this

	umount /local
	lvextend --size +4G /dev/gv00/local
	resize2fs

resize2fs asked me to fsck -f /dev/gv00/local

	mount /local

That was it.
Shrinking is a bit more tricky as you have to be careful shrinking your LVol not to make is 
smaller than the filesystem. 

I've never used tune2fs or e2fsadm for this purpose and I think it's not the way to go.

Hope it helps.

Regards,
Chris

On Thu, 1 Sep 2005 10:28:57 -0500
"Meadows, Howard T" <howard-meadows at uiowa.edu> wrote:

> Chris,
> 
>     Thanks for your reply. The logical volumes in question are ext3
> filesystems. I did read the man page for lvreduce and its warning about
> possible loss of data was what originally prompted me to ask for help.
> 
>     I do not want to resize the partition (they are all on the same
> partition), so I am wondering if e2fsadm might do the trick? It looks like
> you can shrink (and expand) logical volumes using e2fsadm with the
> restriction that shrinking only works on unmounted filesystems (if I'm
> reading the man page correctly). So... my current thought is as follows:
> 
>     * unmount the filesystems in question.
>     * use 'tune2fs -O ^has_journal /dev/sda5' to turn off journaling
>     * use 'e2fsadm -L -100G /dev/vg/lv1' to reduce lv1 by 100GB
>     * use 'e2fsadm -L +100G /dev/vg/lv2' to increase lv2 by 100GB
>     * use 'e2fsck -f /dev/sda5' to check the filesystems
>     * use 'tune2fs -j /dev/sda5' to turn journaling back on
>     * re-mount the filesystems
> 
>     It seems (from the man page for e2fsadm) that lvreduce/lvextend would
> then not be needed. Is this true?
> 
>     I would like to feel more confident that this would actually work before
> I jump in there and do it because I don't feel like looking for a new job if
> it doesn't. ;-)
> 
>     Thanks,
> 
> -Howard
>  
> 
> -----Original Message-----
> From: linux-lvm-bounces at redhat.com [mailto:linux-lvm-bounces at redhat.com] On
> Behalf Of Chris Osicki
> Sent: Wednesday, August 31, 2005 4:28 PM
> To: LVM general discussion and development
> Subject: Re: [linux-lvm] Moving space between logical volumes?
> 
> 
> Hi Howard
> 
> Your start point is "man lvreduce". Depending of the filesystem type
> you're using you would have to find out how to resize the FS _before_
> using lvreduce/lvextend. Depending on the FS type it may or may not be
> possible to do it on a mounted FS. In worst case a boot from Rescue-CD
> would be necessary == down-time.
> 
> You will have to do this:
> 
> 	 resize (decrease size of) the file system on the huge_lvol
> 	 lvreduce huge_lvol
> 	 lvextend tight_lvol
> 	 resize (increase size of) the file system on the tight_lvol
> 
> LVols resizing was I think the first and most important motivation to
> write LVM.
> Good luck.
> 
> Regards,
> Chris
> 
> On Wed, Aug 31, 2005 at 02:56:40PM -0500, Meadows, Howard T wrote:
> > 
> > I have a volume group with 4 logical volumes. One of the logical volumes
> has
> > a huge amount of space allocated to it, and another is running out of its
> > space.
> > 
> > I am assuming there is a way to re-allocate space from the one with lots
> of
> > space to the one that is running out. I am nervous about using losing data
> > with a reduce-extend combination of commands. Can someone who has done
> this
> > explain exactly how this is done (safely)?
> > 
> > Thanks,
> > 
> > -Howard
> > 
> > 
> > =======================================================
> > Howard Meadows                 howard-meadows at uiowa.edu
> > ITS - SPA, Unix Systems Group              319-335-5519
> > The University of Iowa                    Iowa City, IA
> >  
> > 
> 
> 
> 
> > _______________________________________________
> > linux-lvm mailing list
> > linux-lvm at redhat.com
> > https://www.redhat.com/mailman/listinfo/linux-lvm
> > read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
> 
> -- 
> 
> Chris Osicki osk at osk.ch
> Dipl. Informatik-Ing. HTL
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm at redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/




More information about the linux-lvm mailing list