Re: [gentoo-user] Need a clue about merging logical volumes/groups with lvm2

2012-07-22 Thread Neil Bothwick
On Sat, 21 Jul 2012 14:11:03 -0700, walt wrote:

 I have a 500gig disk that is split roughly in half between two volume
 groups, each containing four physical volumes, and each vg is formatted
 into an ext4 filesystem of roughly 250GB.

This doesn't make sense, VGs don't have filesystems, they contain LVs
and they have the filesystems.

 What I plan to do is merge the two volume groups into one, containing
 one big ext4 filesystem, which will contain all of the files currently
 on the disk.

 
 Can this be done without copying one of the existing ext4 filesystems
 to a separate drive first, and then copying it back after extending
 the remaining vg/filesystem? (One filesystem has 24GB free and the
 other has 25GB free.)

It can, by moving data from an LV on one VG to an LV on the other, then
reducing one LV and VG and increasing the other. But with so little free
space, it would take forever, and you'd still end up with a 90%+ full
filesytem.

If you have a spare drive, I'd add a partition on that to the VG you want
to keep, increase the LV size and move everything over. Then remove the
VGs from the second disk, add it to the first VG and use pvmove to move
everything off the spare disk before removing it from the VG. You can
continue to use the system while this runs, so this gives the least
downtime with minimal hassle.


-- 
Neil Bothwick

Never underestimate the bandwidth of a station wagon full of tapes!


signature.asc
Description: PGP signature


Re: [gentoo-user] Need a clue about merging logical volumes/groups with lvm2

2012-07-22 Thread Alan McKinnon
On Sat, 21 Jul 2012 14:11:03 -0700
walt w41...@gmail.com wrote:

 I know there are a few lvm2 experts lurking here :)
 
 I have a 500gig disk that is split roughly in half between two volume
 groups, each containing four physical volumes, and each vg is
 formatted into an ext4 filesystem of roughly 250GB.
 
 What I plan to do is merge the two volume groups into one, containing
 one big ext4 filesystem, which will contain all of the files currently
 on the disk.
 
 Can this be done without copying one of the existing ext4 filesystems
 to a separate drive first, and then copying it back after extending
 the remaining vg/filesystem? (One filesystem has 24GB free and the
 other has 25GB free.)
 
 I'm expecting a no but I'd like to be wrong :)
 
 

For the most part, the answer is no.

But to be totally accurate, it can be done - you just have to shuffle
partitions and contents around on the disk a lot in this fashion:

Move something a bit further towards the end,
Extend the thing in front of it to use the now-free space.

But be warned, it's a complete PITA and a lot like playing the 15
pieces game with your disk volumes.

You have about 10% free space on both vgs, so the odds you can move
things around successfully are not good. Get yourself a 500G portable
drive to help with the migration.


-- 
Alan McKinnon
alan.mckin...@gmail.com




[gentoo-user] Need a clue about merging logical volumes/groups with lvm2

2012-07-21 Thread walt
I know there are a few lvm2 experts lurking here :)

I have a 500gig disk that is split roughly in half between two volume
groups, each containing four physical volumes, and each vg is formatted
into an ext4 filesystem of roughly 250GB.

What I plan to do is merge the two volume groups into one, containing
one big ext4 filesystem, which will contain all of the files currently
on the disk.

Can this be done without copying one of the existing ext4 filesystems
to a separate drive first, and then copying it back after extending
the remaining vg/filesystem? (One filesystem has 24GB free and the
other has 25GB free.)

I'm expecting a no but I'd like to be wrong :)




Re: [gentoo-user] Need a clue about merging logical volumes/groups with lvm2

2012-07-21 Thread Alex Schuster
walt writes:

 I know there are a few lvm2 experts lurking here :)
 
 I have a 500gig disk that is split roughly in half between two volume
 groups, each containing four physical volumes, and each vg is formatted
 into an ext4 filesystem of roughly 250GB.
 
 What I plan to do is merge the two volume groups into one, containing
 one big ext4 filesystem, which will contain all of the files currently
 on the disk.
 
 Can this be done without copying one of the existing ext4 filesystems
 to a separate drive first, and then copying it back after extending
 the remaining vg/filesystem? (One filesystem has 24GB free and the
 other has 25GB free.)
 
 I'm expecting a no but I'd like to be wrong :)

I think you are right.

But if you had more free space, it might be possible. So your physical
volumes are about 63 G each. If you free that much space on one
filesystem, reduce the file system, then reduce the LV, you can use
pvmove to move stuff from one PV you want to empty to the others. When
done, you can remove the now empty PV from the VG with vgreduce. Then use
vgextend to add the PV to the other VG. Extend the LV of that VG and
enlarge the file system, copy stuff from the other FS over until you can
free another PV. And so on.

But copying all stuff of one VG to another location would be much easier.
And less error-prone.

Wonko