Operating System - HP-UX
1752761 Members
5033 Online
108789 Solutions
New Discussion юеВ

Mirroring when root vg contains 2 disks

 
SOLVED
Go to solution
David Burgess
Esteemed Contributor

Mirroring when root vg contains 2 disks

I am playing with a test D class server and I have the root vg on c0t5d0 and c0t8d0. I want to mirror c0t5d0 to c0t9d0 and c0t8d0 to c0t10d0.

lvlnboot -v shows :-

Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c0t5d0 (8/4.5.0) -- Boot Disk
/dev/dsk/c0t8d0 (8/4.8.0)
Boot: lvol1 on: /dev/dsk/c0t5d0
Root: lvol3 on: /dev/dsk/c0t5d0
Swap: lvol2 on: /dev/dsk/c0t5d0
Dump: lvol2 on: /dev/dsk/c0t5d0, 0

So I'll need

pvcreate -B /dev/rdsk/c0t9d0
pvcreate /dev/rdsk/c0t10d0
mkboot /dev/rdsk/c0t9d0
mkboot -a "hpux -lq" /dev/rdsk/c0t5d0
mkboot -a "hpux -lq" /dev/rdsk/c0t9d0

vgextend /dev/vg00 /dev/dsk/c0t9d0 /dev/dsk/c0t10d0

Normally I would mirror using :-

for i in 1 2 3 4 5 6 7 8
do
lvextend -m 1 /dev/vg00/lvol$i /dev/dsk/c0t9d0
done

The problem is lvol7 spans both c0t5d0 and c0t8d0. How do do I handle this and get the remains of lvol7 and all of lvol8 onto c0t10d0?

Is this where PVG's come in?

Regards,

Dave.

8 REPLIES 8
T G Manikandan
Honored Contributor

Re: Mirroring when root vg contains 2 disks

Dave,

Mirroring is based on the logical volume level and not at the disk level.

There will not be any problem until you have space.

But make sure that your mirror boot disk contains the /,/stand and swap ( the imp. system file systems)
Robert-Jan Goossens
Honored Contributor

Re: Mirroring when root vg contains 2 disks

Hi Dave,

# lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c0t9d0 /dev/dsk/c0t10d0

will create the mirro on both disks.

For the last lvol8 use only the t10 disk.

Regards,
Robert-Jan
Pete Randall
Outstanding Contributor

Re: Mirroring when root vg contains 2 disks

Dave,

You don't have to specify the physical volume with your lvextend command, making all the physical volumes eligible to contain a particular mirrored lvol. Assuming your allocation policies are set up normally, this would prevent the original pv's from being used and c0t9d0/c0t10d0 would end up containing your mirrored copies.

Or you can use PVG's.


Pete

Pete
Clemens van Everdingen
Honored Contributor

Re: Mirroring when root vg contains 2 disks

Both suggestions will work !

But indeed this is where PVG's come in !

Just to make ithings easy.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
David Burgess
Esteemed Contributor

Re: Mirroring when root vg contains 2 disks

I've never really used PVG's. How would I do it this way?

Regards,

Dave.
Thierry Poels_1
Honored Contributor

Re: Mirroring when root vg contains 2 disks

hi,

I don't think this is possible in an obvious way.

yes, PVG's are a handy way to mirror some disks, to another set of disks. With PVG's you are sure you mirror are fully separated from the original LVOLs.
But PVG's don't make exact copies, your LVOLs will be mirrored "somewhere" on the PVG.

looking at the syntax:
lvextend -m 1 /dev/vgx/lvolx /dev/dsk/c1t0d0 /dev/dsk/c2t0d0
lvextend will mirror lvolx on c1t0d0, and will continue on c2t0d0 if no space remains on c1t0d0.
If you really need an "exact" copy (performance reasons??), you could fill up the first disk, so it has just enough free PE's as you need for the first part of the logical volume. Then lvextend on the 2 required disk and afterward remove the dummy lvol you created to fill up the disk.

If not for performance reasons, why wouldn't you simply mirror the LVOL (from 2 disks) to one disk?

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Clemens van Everdingen
Honored Contributor
Solution

Re: Mirroring when root vg contains 2 disks

To use PVG's:

Add all the disks to the VG
edit the file /etc/lvmpvg
put in this file the following line

# pg /etc/lvmpvg
VG /dev/vg02
PVG bus1
/dev/dsk/c3t14d0
/dev/dsk/c3t15d0
PVG bus2
/dev/dsk/c0t14d0
/dev/dsk/c0t15d0

The you have to do the next step:
lvchange -s g /dev/vg01/lvol1 (also for the other lvol's) This to put mirroring to strict.
Then do the lvextend -m 1 /dev/vgXX/lvolX

Then it will mirror to the second PVG in your VG.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
David Burgess
Esteemed Contributor

Re: Mirroring when root vg contains 2 disks

Thanks. I've got it working with PVG's and have scripted it into Ignite. I can now build the server with mirrored root VG.

The LE to PE mapping is the same across both sides of the mirror.

Regards,

Dave.