Operating System - HP-UX
1833051 Members
2395 Online
110049 Solutions
New Discussion

Mirroring of 2 discs in the same volume group

 
SOLVED
Go to solution
Tommy_8
Frequent Advisor

Mirroring of 2 discs in the same volume group

I have 2 discs in the same volume group that I need to mirror, the only syntax I can see is to lvextend -m 1 /dev/vg01/lvolX /dev/dsk/cXtXdX, this only points to 1 of the discs, also do I have to vgextend to both the discs I want to mirror.

Regards Tony
5 REPLIES 5
Pete Randall
Outstanding Contributor
Solution

Re: Mirroring of 2 discs in the same volume group

Tony,

MirrorDisk/UX works on the logical volume level. You don't mirror whole disk but rather individual lvol's. The syntax you show will mirror the already existing lvolx onto /dev/dsk/cXtXdX, which has to be part of the same volume group.


Pete

Pete
Steven E. Protter
Exalted Contributor

Re: Mirroring of 2 discs in the same volume group

The logical volume is already on one disk.

find out with the lvdsiplay -v /dev/vg01/lvolX

the lvextend command says in english, make one MIRROR copy of whats out there and put it on this disk.

The command won't work if you point the mirror copy to any of the disks the original is on.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
G. Vrijhoeven
Honored Contributor

Re: Mirroring of 2 discs in the same volume group

Hi Tony,

The mirroring takes place on lvol level. So
if you need to create new mirrored lvols i would suggest
lvcreate -M1 -L /dev/vgname

If you have two disks in the vg UX knows that is should use both disks.

and you create one mirrored.

If you have a lvol on one disk and you need to add a mirror just use the lvextend command you found.

HTH,

Gideon

Gideon
Chris Hulihan
Advisor

Re: Mirroring of 2 discs in the same volume group

It sounds like you have a volume group and you need to have all of the "logical volumes" mirrored.

This is going to depend on how your system is set up.

do a strings /etc/lvmtab -- are these devices in one volume group or two?

How many disks are you going to mirror onto?

Are you mirroring disks that are used for booting? (this will change how you do this slightly).

basically you have to
pvcreate (-B if boot) -f /dev/rdsk/

vgextend /dev/ /dev/dsk/

for each logical volume,
lvextend -m 1 /dev// /dev/dsk/

(this is assuming this is not a boot disk, and that you already have mirror disk/ux installed. If you get an error about the -m option, it probably means Mirror/DIsk UX is not installed yet and you'll have to purchase/install it).

Chris Hulihan
Advisor

Re: Mirroring of 2 discs in the same volume group

Also, a shortcut that could help depending on your situation...

vgdisplay -v |grep "LV Name"|awk '{print $3}'|while read v;do;lvextend -m 1 $v /dev/dsk/;done

will mirror each logical volume, but this will only work if you have one disk device that everything is going to mirrored onto (if you had one 8 GB device that you were going to mirror all the data onto, for example).