1748275 Members
3707 Online
108761 Solutions
New Discussion юеВ

Re: Remove a mirror .

 
Chapaya
Frequent Advisor

Remove a mirror .

Hello ,
I have a logical volume : /dev/vg01/lvol1
with 2 disks c0t2d0 (master) & c0t8d0 (slave) .
I want to remove the mirror and to have the slave disk on new vg - VG02 .
I thougt to do it with vgchgid but i must have EMC disks .
Give me the set of commands to do it .
Thanks ,
Eran .
7 REPLIES 7
Robert-Jan Goossens
Honored Contributor

Re: Remove a mirror .

Hi Eran,

# lvextend -m 0 /dev/vg01/lvol1
# vgreduce /dev/vg01 /dev/dsk/c0t8d0
# vgextend /dev/vg02 /dev/dsk/c0t8d0

Regards,
Robert-Jan
Elmar P. Kolkman
Honored Contributor

Re: Remove a mirror .

1 error I guess: you need to use lvreduce instead of lvextend:
lvreduce -m 0 /dev/vg01/lvol1 /dev/dsk/c0t8d0

This way you're also certain it stops mirroring to that disk and not the other one, because LVM sees no difference between slaves and masters...

Every problem has at least one solution. Only some solutions are harder to find.
Robert-Jan Goossens
Honored Contributor

Re: Remove a mirror .

HUmmm thanks Elmar. need some coffee (:-)
Massimo Bianchi
Honored Contributor

Re: Remove a mirror .

vgchgid is only used for changing the vgid on ALL of the disks belonging to a vg, in some cases, usually with emc or xp disks (but also shark, va, clarion).

For the reduction of the mirror, follow the steps above.

DO not ever use vgchgid on only one disk of a vg, unless you want to gain deep knoledge on lvm, because it is a very destructive operation.


Massimo
Jean-Louis Phelix
Honored Contributor

Re: Remove a mirror .

Hi,

Perhaps Eran is right ... and the question isn't clear :-) !

If you have a mirrored VG and you want to create 2 new VG with the same data on disks without having to recreate the lvm structure or copy the data the procedure could basically be as follows, but fully not supported ...

- deactivate the vg
- export the vg
- create and import the vg with only the first disk.
- lvreduce the missing copy using lvreduce -k -m 0 key (get the key using lvdisplay -v -k, it's the number of the missing disk)
- vgreduce -f the vg

- vgchgid the second disk
- import the new vg and do the same other things with lvreduce

It could work ... I didn't test. Take a good backup first !!! Also be careful of the lvreduce man page which seems to be wrong for the -k usage (in the synopsis, in the option description and in the example !).

Syntax is :

lvreduce -m 0 -k /dev/vgxxx key

Regards.


It works for me (┬й Bill McNAMARA ...)
Chapaya
Frequent Advisor

Re: Remove a mirror .

Hello ,

According to Jean , it's impossible to activate a VG just with one disk :( .

Vgchgid is working just on EMC disks and not on regular disks .

BR ,
Eran .
Todd McDaniel_1
Honored Contributor

Re: Remove a mirror .

Eran,

So am I understanding you are going to be unmirrored SPOF on vg01? and vg02? having only one disk in vg01 and 1 disk in vg02? OR are you later going to add a mirror back to each of them after you split them?

Also, what is your ultimate goal here? are you trying to duplicate your data on a new VG/LVOL filesystem?

IF so you can merely create the new vg02 with your other disks and do a straight copy over... with out all the disk manipulation...

Please correct me if my assumption is wrong.
Unix, the other white meat.