[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Resizing LVM partition

On Sat, Mar 28, 2009 at 12:08:43PM -0300, Daniel Bareiro (daniel-listas@gmx.net) wrote:

> But I would like, to be possible, not to have to be creating
> partitions by each disk that could be adding.

Well, it is possible, just hard compared to creating
new partitions. Extra partitions don't really cost anything
and make it easier to rearrange things should you wish to
create multiple volume groups later.

I've got a box with a total of 29 partitions on five disks, divided
among four volume groups (and 2 non-lvm for soft-mirrored /boot),
partly for historical reasons, partly by design, with no detectable
performance impact, and I've done things like splitting a volume group
in two in order to encrypt half of it, and replacing root disk without
shutting the system down. I like lvm!

Anyway, if you really want to enlarge the lvm partition,
all you need to do is
(1) use (e.g.) fdisk to remove the partition and recreate
    it at same starting position but new end position;
(2) extend the physical volume with pvresize.

You may need to boot in between, and you might wish
to do (1) in single-user mode and with the
volume group deactivated (vgchange -a n).

Caveat emptor: any mistakes (including things I've made
by forgetting something) may result in loss of data.
Fresh backup before starting is recommended.

Tapani Tarvainen

Reply to: