LVM question : how to merge 2 VGs intoa single one without data loss ?

  • Follow


Hi !

Is there any way to merge 2 PVs belonging to 2 *different* VGs into 1
VG *without* losing data already stored in the 2 PVs ?

I'm working on AIX 5.3 ML4.
I've got 2 different VGs, each with only one PV. Each VGs contains
only one LV/FS (jfs2) + the jfslog LV.
The FS (and the VGs) are big : around 12 Tb each. One of them is
nearly full, the other one is not so full.
The idea is to merge the VGs so I can reduce the FS/LV which is not-so-
full, to later extend the one which is full.
Of course, with the amount of data in play, I'd like to avoid backing
up/restore it.

I've tried to exportvg both VGs then recreatevg with both PVs but it
doesn't work. Any ideas ?

Thanks.
0
Reply frederic.hummel (1) 12/22/2009 8:12:23 AM

Am 22.12.2009 09:12, schrieb ZeDeufr:
> Hi !
>
> Is there any way to merge 2 PVs belonging to 2 *different* VGs into 1
> VG *without* losing data already stored in the 2 PVs ?
>
> I'm working on AIX 5.3 ML4.
> I've got 2 different VGs, each with only one PV. Each VGs contains
> only one LV/FS (jfs2) + the jfslog LV.
> The FS (and the VGs) are big : around 12 Tb each. One of them is
> nearly full, the other one is not so full.
> The idea is to merge the VGs so I can reduce the FS/LV which is not-so-
> full, to later extend the one which is full.
> Of course, with the amount of data in play, I'd like to avoid backing
> up/restore it.
>
> I've tried to exportvg both VGs then recreatevg with both PVs but it
> doesn't work. Any ideas ?
>
> Thanks.

Hi,

to my knowledge - no way. There is no offical AIX command or any 
combination of LVM commands to achieve what you want. The only way to 
get both LVs into the same VG is:
- get a third disk hdisk3
- add hdisk3 to VG1
- create a LV3 on VG1 of exact the same size of LV2 on VG2
- Use "cplv -e LV3 LV2" (after having read man page for cplv)
   (But cplv will take really very long on a 8 or 10 TB LV)

In fact, I do not understand why you are not working with more than 1 
LV/FS per VG ?

Regards,
Uwe Auer
0
Reply Uwe 12/22/2009 10:12:58 AM


On 22 d=E9c, 11:12, Uwe Auer <u...@franke-auer.de> wrote:
> Am 22.12.2009 09:12, schrieb ZeDeufr:
>
>
>
>
>
> > Hi !
>
> > Is there any way to merge 2 PVs belonging to 2 *different* VGs into 1
> > VG *without* losing data already stored in the 2 PVs ?
>
> > I'm working on AIX 5.3 ML4.
> > I've got 2 different VGs, each with only one PV. Each VGs contains
> > only one LV/FS (jfs2) + the jfslog LV.
> > The FS (and the VGs) are big : around 12 Tb each. One of them is
> > nearly full, the other one is not so full.
> > The idea is to merge the VGs so I can reduce the FS/LV which is not-so-
> > full, to later extend the one which is full.
> > Of course, with the amount of data in play, I'd like to avoid backing
> > up/restore it.
>
> > I've tried to exportvg both VGs then recreatevg with both PVs but it
> > doesn't work. Any ideas ?
>
> > Thanks.
>
> Hi,
>
> to my knowledge - no way. There is no offical AIX command or any
> combination of LVM commands to achieve what you want. The only way to
> get both LVs into the same VG is:
> - get a third disk hdisk3
> - add hdisk3 to VG1
> - create a LV3 on VG1 of exact the same size of LV2 on VG2
> - Use "cplv -e LV3 LV2" (after having read man page for cplv)
> =A0 =A0(But cplv will take really very long on a 8 or 10 TB LV)
>
> In fact, I do not understand why you are not working with more than 1
> LV/FS per VG ?
>
> Regards,
> Uwe Auer- Masquer le texte des messages pr=E9c=E9dents -
>
> - Afficher le texte des messages pr=E9c=E9dents -

Thanks for answering.

There is no deliberate choice from us to have only 1 LV/FS per VG.
It's just the way it has been done on that particular server.
Had it been thought of before, we would have created 1 VG for the two
LV/FS, and wouldn't have had any problem reducing one of them to
extend the other...
Now I'm stuck with the current situation, and have to do with it !

If there is no clean way to achieve what I'd like to, I guess we'll
have to backup/restore the data of the smaller of the two FS.
I suppose we could mess with the VGDA using "dd" to try changing the
VGID or something, but I'm not fond of doing this on the production
server, even if it could be proved successful on a test machine (which
I doubt anyway).

Regards,
Fr=E9d=E9ric.
0
Reply ZeDeufr 12/22/2009 1:21:44 PM

Am 22.12.2009 14:21, schrieb ZeDeufr:
> On 22 d�c, 11:12, Uwe Auer<u...@franke-auer.de>  wrote:
>> Am 22.12.2009 09:12, schrieb ZeDeufr:
>>
>>
>>
>>
>>
>>> Hi !
>>
>>> Is there any way to merge 2 PVs belonging to 2 *different* VGs into 1
>>> VG *without* losing data already stored in the 2 PVs ?
>>
>>> I'm working on AIX 5.3 ML4.
>>> I've got 2 different VGs, each with only one PV. Each VGs contains
>>> only one LV/FS (jfs2) + the jfslog LV.
>>> The FS (and the VGs) are big : around 12 Tb each. One of them is
>>> nearly full, the other one is not so full.
>>> The idea is to merge the VGs so I can reduce the FS/LV which is not-so-
>>> full, to later extend the one which is full.
>>> Of course, with the amount of data in play, I'd like to avoid backing
>>> up/restore it.
>>
>>> I've tried to exportvg both VGs then recreatevg with both PVs but it
>>> doesn't work. Any ideas ?
>>
>>> Thanks.
>>
>> Hi,
>>
>> to my knowledge - no way. There is no offical AIX command or any
>> combination of LVM commands to achieve what you want. The only way to
>> get both LVs into the same VG is:
>> - get a third disk hdisk3
>> - add hdisk3 to VG1
>> - create a LV3 on VG1 of exact the same size of LV2 on VG2
>> - Use "cplv -e LV3 LV2" (after having read man page for cplv)
>>     (But cplv will take really very long on a 8 or 10 TB LV)
>>
>> In fact, I do not understand why you are not working with more than 1
>> LV/FS per VG ?
>>
>> Regards,
>> Uwe Auer- Masquer le texte des messages pr�c�dents -
>>
>> - Afficher le texte des messages pr�c�dents -
>
> Thanks for answering.
>
> There is no deliberate choice from us to have only 1 LV/FS per VG.
> It's just the way it has been done on that particular server.
> Had it been thought of before, we would have created 1 VG for the two
> LV/FS, and wouldn't have had any problem reducing one of them to
> extend the other...
> Now I'm stuck with the current situation, and have to do with it !
>
> If there is no clean way to achieve what I'd like to, I guess we'll
> have to backup/restore the data of the smaller of the two FS.
> I suppose we could mess with the VGDA using "dd" to try changing the
> VGID or something, but I'm not fond of doing this on the production
> server, even if it could be proved successful on a test machine (which
> I doubt anyway).
>
> Regards,
> Fr�d�ric.

Hi,

forget about the "dd" thing. Even if you would be able to figure out the binary 
structure of VGDA it would be required to change ODM, LVCB and there respective 
references too. There must be a reason why there is no "mergevg" command :-)

PS: Still got not the point, why you are not using *additional* logical 
volumes/filesystems to increase your existing structure. Is the directory 
structure that flat that you cannot split it up to more than one filesystem ?

Regards,
Uwe Auer
0
Reply Uwe 12/22/2009 2:49:30 PM

On 22 d=E9c, 15:49, Uwe Auer <u...@franke-auer.de> wrote:
> Am 22.12.2009 14:21, schrieb ZeDeufr:
>
>
>
>
>
> > On 22 d=E9c, 11:12, Uwe Auer<u...@franke-auer.de> =A0wrote:
> >> Am 22.12.2009 09:12, schrieb ZeDeufr:
>
> >>> Hi !
>
> >>> Is there any way to merge 2 PVs belonging to 2 *different* VGs into 1
> >>> VG *without* losing data already stored in the 2 PVs ?
>
> >>> I'm working on AIX 5.3 ML4.
> >>> I've got 2 different VGs, each with only one PV. Each VGs contains
> >>> only one LV/FS (jfs2) + the jfslog LV.
> >>> The FS (and the VGs) are big : around 12 Tb each. One of them is
> >>> nearly full, the other one is not so full.
> >>> The idea is to merge the VGs so I can reduce the FS/LV which is not-s=
o-
> >>> full, to later extend the one which is full.
> >>> Of course, with the amount of data in play, I'd like to avoid backing
> >>> up/restore it.
>
> >>> I've tried to exportvg both VGs then recreatevg with both PVs but it
> >>> doesn't work. Any ideas ?
>
> >>> Thanks.
>
> >> Hi,
>
> >> to my knowledge - no way. There is no offical AIX command or any
> >> combination of LVM commands to achieve what you want. The only way to
> >> get both LVs into the same VG is:
> >> - get a third disk hdisk3
> >> - add hdisk3 to VG1
> >> - create a LV3 on VG1 of exact the same size of LV2 on VG2
> >> - Use "cplv -e LV3 LV2" (after having read man page for cplv)
> >> =A0 =A0 (But cplv will take really very long on a 8 or 10 TB LV)
>
> >> In fact, I do not understand why you are not working with more than 1
> >> LV/FS per VG ?
>
> >> Regards,
> >> Uwe Auer- Masquer le texte des messages pr=E9c=E9dents -
>
> >> - Afficher le texte des messages pr=E9c=E9dents -
>
> > Thanks for answering.
>
> > There is no deliberate choice from us to have only 1 LV/FS per VG.
> > It's just the way it has been done on that particular server.
> > Had it been thought of before, we would have created 1 VG for the two
> > LV/FS, and wouldn't have had any problem reducing one of them to
> > extend the other...
> > Now I'm stuck with the current situation, and have to do with it !
>
> > If there is no clean way to achieve what I'd like to, I guess we'll
> > have to backup/restore the data of the smaller of the two FS.
> > I suppose we could mess with the VGDA using "dd" to try changing the
> > VGID or something, but I'm not fond of doing this on the production
> > server, even if it could be proved successful on a test machine (which
> > I doubt anyway).
>
> > Regards,
> > Fr=E9d=E9ric.
>
> Hi,
>
> forget about the "dd" thing. Even if you would be able to figure out the =
binary
> structure of VGDA it would be required to change ODM, LVCB and there resp=
ective
> references too. There must be a reason why there is no "mergevg" command =
:-)
>
> PS: Still got not the point, why you are not using *additional* logical
> volumes/filesystems to increase your existing structure. Is the directory
> structure that flat that you cannot split it up to more than one filesyst=
em ?
>
> Regards,
> Uwe Auer- Masquer le texte des messages pr=E9c=E9dents -
>
> - Afficher le texte des messages pr=E9c=E9dents -

The point is we don't have any free disk space to increase either VG.
That's why I was looking for a way to merge the 2 VGs into a single
one without having to backup/restore data.
The (rather stupid) way it has been designed, we have a full disk
cabinet dedicated to storage (SAN), sliced up into disks attached to
the VGs.
Each of my VG is made of 1 LUN (no other available), filled with 1 LV
taking whole disk space except for the jfslog.

Hope this answers your question.

Regards
Fr=E9d=E9ric.
0
Reply ZeDeufr 12/23/2009 2:53:24 PM

In comp.unix.aix, ZeDeufr <frederic.hummel@gmail.com> wrote:

>The point is we don't have any free disk space to increase either VG.

Reduce the logical volume in VG2 that isn't full to free up space.
Create a new LV in VG2.
Mount a filesystem in that LV, below the tree somewhere in the filesystem
on VG1.

That's the whole point of filesystems and the original question that was
being asked.  Is the directory structure in VG1 (the full one) totally
flat, or is there no-where in that structure you could mount another
filesystem (which happens to be in a new LV on VG2) that would alleviate
the space issue.

-- 
Tony Evans
Saving trees and wasting electrons since 1993
blog -> http://perceptionistruth.com/
olmr -> http://www.onelinemoviereviews.co.uk/
[ anything below this line wasn't written by me ]
0
Reply Tony 12/23/2009 4:36:14 PM

As detailed above numerous times, its is not possible, you will have
to create a new VG / LV / Filesystem and migrate the data, you have no
other option.  I am assuming that you have a DR solution and you have
tested the restore of sed data on your DR system, if so, and the data
is ok and not corrupt, then you can blow away the disks and data,
create the config you want to end up with and restore the data ..

NB: if you have considered dd'ing and editing the vgda's over a much
simpler solution as above, then really I think you shouldn't really be
allowed near a computer as its sounds as if you are a bit of a
liability.

HTH
Mark Taylor
0
Reply Mark 1/7/2010 5:27:42 PM

6 Replies
470 Views

(page loaded in 0.153 seconds)

Similiar Articles:










7/23/2012 10:28:29 AM


Reply: