Operating System - HP-UX
1833811 Members
3879 Online
110063 Solutions
New Discussion

Re: How to mirror multiple disks.

 
SOLVED
Go to solution
Viswanadhan
Regular Advisor

How to mirror multiple disks.

Hi Admins,

Im planing to mirror 4 new disks to remaining 4 disks.( new volume group ).

For example :

I have 8 HDDS( c1t1d1, c1t1d2, c1t1d3 ... c1t1d8 ) with 9GB size of each disk.

I will create logical volume lvol88 with 36gb( c1t1d1, c1t1d2,c1t1d3,c1t1d4).

Now i want to mirror 36gb with remianing 4 disk ( c1t1d5, c1t1d6, c1t1d7, c1t1d8).

I know following things

1. mkdir /dev/vg99
2. mknod /dev/vg88/group c 64 0x880000
3. vgcreate /dev/vg88 /dev/dsk/c1t1d1 /dev/dsk/c1t1d2 /dev/dsk/c1t1d3 /dev/dsk/c1t1d4
4. lvcreate -L 36gb -n lvol88 vg88 ( is this command correct )

Now i shall add reaming to 4 disks to vg88

For mirror i shall do following thing.

5. lvextend –m 1 /dev/vg88/lvol88 /dev/dsk/c1t1d5 /dev/dsk/c1t1t6 /dev/dsk/c1t1t7 /dev/dsk/c1t1d8 ( is this command correct )

Please guide me.

Regards,
Viswa.
9 REPLIES 9
Torsten.
Acclaimed Contributor
Solution

Re: How to mirror multiple disks.

Consider to use distributed extends (see http://docs.hp.com/en/B2355-60105/lvcreate.1M.html ) together with physical volume groups (see http://docs.hp.com/en/B2355-60105/lvmpvg.4.html )

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
skt_skt
Honored Contributor

Re: How to mirror multiple disks.

vgextend vgname d5 d6 d7 d8

then your lvextend step
Sp4admin
Trusted Contributor

Re: How to mirror multiple disks.

Didn't you just ask this question the other day?

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1160878

sp,
Viswanadhan
Regular Advisor

Re: How to mirror multiple disks.

Hi Santosh,

U meen to say that the following commands are correct ?

# lvcreate -L 36gb -n lvol88 vg88 ( is this command correct )

or

# lvcreate -L 36gb -i 4 -n lvol88 vg88 ( is this command correct )

# pvcreate /dev/rdsk/c1t1d5 .. /dev/rdsk/c1t1d8

# vgextend vg88 /dev/dsk/c1t1d5 .. /dev/dsk/c1t1d8

# lvextend -m 1 /dev/vg88/lvol88 /dev/dsk/c1t1d5 .. /dev/dsk/c1t1d8

Regards,
Viswa.
Torsten.
Acclaimed Contributor

Re: How to mirror multiple disks.

You should take some time and read in

http://docs.hp.com/en/B2355-60105/lvcreate.1M.html

the section named

"Distributed Allocation Policy"

This will give you the best result.


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   

Re: How to mirror multiple disks.

Hello Viswa,

As first you should "initialize" the physical volumes (c1t1d1 ... c1t1d8).
As I assume from your VG name "vg88" the new VG will not be your Boot-VG (usually this is vg00).

1) Initialize the all new disks:

pvcreate /dev/rdsk/c1t1d1
pvcreate /dev/rdsk/c1t1d2
pvcreate /dev/rdsk/c1t1d3
pvcreate /dev/rdsk/c1t1d4

pvcreate /dev/rdsk/c1t1d5
pvcreate /dev/rdsk/c1t1d6
pvcreate /dev/rdsk/c1t1d7
pvcreate /dev/rdsk/c1t1d8

Hmm... This looks like as if all your disks are on the same controller / array.
Usually for availability aspects this it not a very good idea, but for testing / learning issues this is ok.



2) Create the new VolumeGroup vg88:

a.) mkdir /dev/vg88
b.) mknod /dev/vg88/group c 64 0x880000
c.) vgcreate -l 32 -s 64 -p 32 -g mirror0 /dev/vg88 /dev/dsk/c1t1d1 /dev/dsk/c1t1d2 /dev/dsk/c1t1d3 /dev/dsk/c1t1d4

=> these disks are "oraganized" in PhysicalDiskGroup with the name "mirror0"


-l 32 : maximum of 32 Volumes in your vg88 should be sufficient
-s 64 : PhysicalExtend (PE) Size = 64 MB, i.e. when you grow your Volume this would be in 64MB-steps.
-p 32 : max of 32 physical volumes (disks cXtYdZ) can be configured into your vg88 (default if parameter is not set: 16 phys. volumes... and you have already 8)

-> All the VG Parameters cannot be changed once the VG is created.

Add the new ("mirror") disks to your vg88:

d.) vgextend -g mirror1 vg00 /dev/dsk/c1t1d5 /dev/dsk/c1t1d6 /dev/dsk/c1t1d7 /dev/dsk/c1t1d8

=> these disks are "oraganized" in PhysicalDiskGroup with the name "mirror1"

3) Create the mirrored Volume lvol88 :
as you have many disks, make sure "strict" policy for your Volume is used, so that the mirror is really on different disks.
For this reason we have created the PVGs (PhysicalDiskGroups) before :-)

lvcreate -D y -s g -m 1 -L 36864 -n lvol88 /dev/vg88

-D y : the allocation policy is distributed, so on PVG "mirror0", the 1st PE is allocated from c1t1d1, the 2nd PE is allocated from c1t1d2, the 3rd PE is allocated from c1t1d3, the 4th PE is allocated from c1t1d4, the 5th PE is allocated again from c1t1d1 and so forth.
Then the Mirror is created (option "-m 1") on PVG "mirror1" (due to strict allocation policy option "-s g") in the analogous manner as the "mirror0".


You are done.

I hope I could help you and give you.

Regards,
Carsten
Viswanadhan
Regular Advisor

Re: How to mirror multiple disks.

Hi Admins,

Sorry for trouble.

I got one idea that,

I have existing volume group vg05(c0t12d0 - 18gb, c1t1d0-18gb) with lvol05 with 8gb, and lvol06 with 10gb.

I want to increase the size of lvol05 more 9gb( 8gb+9gb)

Now I do following things

# pvcreate /dev/rdsk/c2t1d0
# vgextend vg05 /dev/dsk/c2t1d0
# umount /u05

# lvreduce -m 0 /dev/vg05/lvol05 /dev/dsk/c1t1d0 ( is this imp ? )
# lvextend -L 9gb /dev/vg05/lvol05 /dev/dsk/c2t1d0
# extendfs /dev/vg05/lvol05
# lvextend -m 1 /dev/vg05/lvol05 /dev/dsk/c1t1d0 /dev/vg05/c2t1d0

The above commands works for me ?

Regards,
Viswa.
Viswanadhan
Regular Advisor

Re: How to mirror multiple disks.

Hi Admins,

Temporarily it's postponed to next week.

Thanks to all.

Regards,
Viswa.

Re: How to mirror multiple disks.

Hello Viswa,

no, you must extend with 2 disks to get a mirrored volume.
You need not to reduce the volume to "unmirrored" ( -m 0 ) first.

I want to increase the size of lvol05 more 9gb( 8gb+9gb)

You need to do:

# pvcreate /dev/rdsk/c2t1d0
# pvcreate /dev/rdsk/c3t1d0 (if this exists)

# vgextend vg05 /dev/dsk/c2t1d0 /dev/dsk/c3t1d0

# umount /u05

lvextend:
-L new_total_size_in_MegaByte

# lvextend -L 17gb /dev/vg05/lvol05 /dev/dsk/c2t1d0 /dev/dsk/c3t1d0
# extendfs /dev/vg05/lvol05

Regards,
Carsten