From: Mister B on
I'm using RHEL 4.5, which has been loaded as one large root Logical
Volume.
I'd like to shrink the logical volume, then create some new logical
volumes.
How can I do that?

I'm guessing I need to do it in single-user? Or did I need to boot
from CD etc?

TIA
Mark
From: unruh on
On 2010-06-11, Mister B <mark.bergman(a)thales-is.com> wrote:
> I'm using RHEL 4.5, which has been loaded as one large root Logical
> Volume.
> I'd like to shrink the logical volume, then create some new logical
> volumes.
> How can I do that?
>
> I'm guessing I need to do it in single-user? Or did I need to boot
> from CD etc?

You cannot alter a partition that is mounted. Since your one partition
must be mounted to run the OS, you cannot change it.
Boot from a CD and change it from there.

>
> TIA
> Mark
From: Aragorn on
On Friday 11 June 2010 13:39 in comp.os.linux.misc, somebody identifying
as Mister B wrote...

> I'm using RHEL 4.5, which has been loaded as one large root Logical
> Volume. I'd like to shrink the logical volume, then create some new
> logical volumes. How can I do that?

I'm afraid that you cannot shrink a logical volume once it has been
created. Logical volumes can be expanded, but not shrunk. In addition
to that, the type of the filesystem used on any partition or logical
volume also may have limitations to what is possible in terms of
resizing.

> I'm guessing I need to do it in single-user? Or did I need to boot
> from CD etc?

The best course of action, in my humble opinion, would be to back up any
important data you may have under your "/home", and I would also
include everything under "/etc" for good measure. Back it up to
whatever external media you have available, and then reinstall the
system with the partitioning and LVM layout you want, and restore your
backups.

If you've made important changes to any of the configuration files
in "/etc", then you can restore the backups of the configuration files
you've changed - which you will need to do in single-user mode, or
better still, from a Live CD. You don't need to be in single-user mode
to restore the backups of "/home", but it is best not to be logged in
as an unprivileged user when you do that.

--
*Aragorn*
(registered GNU/Linux user #223157)
From: Pascal Hambourg on
Hello,

unruh a �crit :
>
> You cannot alter a partition that is mounted.

Some filesystems such as ext3 or XFS allow online growing. Granted, I do
not know any which allows online shrinking (but it does not mean that it
does not exist).

> Since your one partition
> must be mounted to run the OS, you cannot change it.
> Boot from a CD and change it from there.

Or create an initramfs containing the resizing tools and a shell and
shrink the filesystem and volume from there.
From: Pascal Hambourg on
Aragorn a �crit :
>
> I'm afraid that you cannot shrink a logical volume once it has been
> created. Logical volumes can be expanded, but not shrunk.

Huh ? What about lvreduce ?