Operating System - HP-UX
1826780 Members
1668 Online
109702 Solutions
New Discussion

VG creation and mirroring

 
SOLVED
Go to solution
Hasan_9
Regular Advisor

VG creation and mirroring

Hello,
I have 6 disks in my server. I want to create a VG with 3 of them and use the others as a mirror of the VG. I have installed MirrorDisk/UX on the server too. What should I do? Whould you please provide the commands for me?

Hasan
13 REPLIES 13
Chan 007
Honored Contributor
Solution

Re: VG creation and mirroring

Hasan,

See the link below and follow Tiziano

Please ensure that your create /etc/lvmpvg to avoid mirroring on the 1st 3 disks.

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

Chan
Warren_9
Honored Contributor

Re: VG creation and mirroring

hi,

# pvcreate /dev/rdsk/... <-- initialize 6 disk
# mkdir /dev/vg99
# mknod /dev/vg99/group c 64 0x0?0000
# vgcreate vg99 /dev/dsk/... <-- 3 disks
# lvcreate .....
# vgextend vg99 /dev/dsk/... <-- another 3 disks
# lvextend -m 1 [LV] [PV] ..

if you not familiar with the command, use "sam" to create the VG and LV.

GOOD LUCK!!

Luk Vandenbussche
Honored Contributor

Re: VG creation and mirroring

Hi Hasan

Create a VG with all your disks

mkdir /dev/vgxx
mknod /dev/vgxx/group c 64 0x0y0000
vgcreate vgxx /dev/dsk/cxtydz

Create your logical volume

lvcreate -n name -L size -m 1 /dev/vgxx
Ninad_1
Honored Contributor

Re: VG creation and mirroring

1. Use pvcreate for all the disks to make thme usable by LVM
pvcreate /dev/dsk/cxtydz
2. mkdir /dev/vgname [ create dir with VG name you want to use - say vgnew ]
3. ls -l /dev/*/group
Check the minor nos. for the files
64 0x100000 etc
Then select a uniqe minor no which hasnt been used - of the format 0xNN0000 (select unique value for NN)
Then
mknod /dev/vgname/group c 64 0xNN0000 [ Put the actual number instead of NN ]
4. vgcreate -p 64 -g VGNEWPri /dev/vgname disk1 disk2 disk3 [ This will create a VG with the 1st 3 disks and put the disks in a PV group named say VGNEWPRI ]
5. vgextend -g VGNEWMIR /dev/vgname disk4 disk5 disk6
6. Then create the logical volumes
lvcreate -L 100 -n testvol1 -m 1 -s g /dev/vgname [ This will create a mirrored volume of size 100 MB which will use disks from the 2 PV groups ]
7. Create filesystem for the volumes
Thats it

Regards,
Ninad
5. Create
MarkSyder
Honored Contributor

Re: VG creation and mirroring

Are you sure about this? It's best to keep operating system and application stuff separate, so my suggestion would be to use two mirrored discs for vg00, two for vg01, and two for vg02. This way, not only do you keep os and application stuff separate, but you can balance the application load over vg01 and vg02 as well.

SAM is very good for setting up VGs and mirroring.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
rariasn
Honored Contributor

Re: VG creation and mirroring

... and attach 3 disk to one card and 3 disk to another.

ran.
Hasan_9
Regular Advisor

Re: VG creation and mirroring

Thank you Everybody,
I created a VG with Disks #1,2,3 and mirror the VG to Disks #4,5,6. Now How can I find out which of the mirrored disk is a mirror of disk #1?

Ninad_1
Honored Contributor

Re: VG creation and mirroring

Hasan,

To correct you a bit, the mirroring here is not disk to disk but you mirror logical volumes.
Thus when you create logical volumes which are having mirrors, only then you can see which disks is the volume using for mirroring.
Hope this clarifies.

Regards,
Ninad
Enrico P.
Honored Contributor

Re: VG creation and mirroring

Hi,
the command lvdisplay -v /dev/vg_name/lvol_name show to you the primary an the mirror disk of the lvol

Enrico
Hasan_9
Regular Advisor

Re: VG creation and mirroring

Thank you,

What happen for VG if disk #1 would be failed?
Enrico P.
Honored Contributor

Re: VG creation and mirroring

Probably you will see the message "could not attach the physical volume /dev/dsk/cxtxdx" but the lvol will work with the mirror disk.

Enrico
Ninad_1
Honored Contributor

Re: VG creation and mirroring

If disk#1 fails, then there will be a message in syslog about the disk failure, nothing will happen to your VG. The volumes which were using disk#1 will now use the mirror copy for them from the other disk/disks.
Once you replace the faulty disk, you need to do a pvcreate, vgcfgrestore -n vgame diskname ; the volumes which had mirror copies on that disk will be stale and you need to do a vgsync to synchronise the stale volumes.

Regards,
Ninad
Enrico P.
Honored Contributor

Re: VG creation and mirroring

Check with the command lvdisplay -v /dev/vgname/lvolname if your mirror is correct (primary and mirror disk different)

Enrico