Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Cc: w41ter@×××××.com
Subject: Re: [gentoo-user] Need a clue about merging logical volumes/groups with lvm2
Date: Sun, 22 Jul 2012 15:48:52
Message-Id: 20120722174652.41ab176b@khamul.example.com
In Reply to: [gentoo-user] Need a clue about merging logical volumes/groups with lvm2 by walt
1 On Sat, 21 Jul 2012 14:11:03 -0700
2 walt <w41ter@×××××.com> wrote:
3
4 > I know there are a few lvm2 experts lurking here :)
5 >
6 > I have a 500gig disk that is split roughly in half between two volume
7 > groups, each containing four physical volumes, and each vg is
8 > formatted into an ext4 filesystem of roughly 250GB.
9 >
10 > What I plan to do is merge the two volume groups into one, containing
11 > one big ext4 filesystem, which will contain all of the files currently
12 > on the disk.
13 >
14 > Can this be done without copying one of the existing ext4 filesystems
15 > to a separate drive first, and then copying it back after extending
16 > the remaining vg/filesystem? (One filesystem has 24GB free and the
17 > other has 25GB free.)
18 >
19 > I'm expecting a "no" but I'd like to be wrong :)
20 >
21 >
22
23 For the most part, the answer is no.
24
25 But to be totally accurate, it can be done - you just have to shuffle
26 partitions and contents around on the disk a lot in this fashion:
27
28 Move something a bit further towards the end,
29 Extend the thing in front of it to use the now-free space.
30
31 But be warned, it's a complete PITA and a lot like playing the "15
32 pieces" game with your disk volumes.
33
34 You have about 10% free space on both vgs, so the odds you can move
35 things around successfully are not good. Get yourself a 500G portable
36 drive to help with the migration.
37
38
39 --
40 Alan McKinnon
41 alan.mckinnon@×××××.com