Operating System - HP-UX
1832994 Members
2605 Online
110048 Solutions
New Discussion

Re: How to mirror another disk to create a three-way mirror.

 
SOLVED
Go to solution
Gino Castoldi_2
Honored Contributor

How to mirror another disk to create a three-way mirror.

Hi,

Server: HP-UX 11.0, Mirror/UX, LVM, L2000, 9GB system disks.

Background:
I have an L2000 server that has two 9GB disks
that are mirrored using Mirror/UX. I have a spare 9GB disk (same type & model). I want to "mirror" that spare disk with the other two system disks. Also before I apply the latest patches to the O/S I want to "break out" the spare disk from the mirror so that I have a "before" copy of the O/S for recovery purposes.

How would I go about doing this?

(10 points to any good answer).
Thank you, Gino.
22 REPLIES 22
Paula J Frazer-Campbell
Honored Contributor
Solution

Re: How to mirror another disk to create a three-way mirror.

Hi

Mirroring the root disk with LVM

To mirror an existing root volume:
1. pvcreate -B /dev/rdsk/device (-B creates BDRA area)
2. vgextend /dev/vg00 /dev/dsk/device
3. mkboot /dev/rdsk/device (put boot utilities into boot area)
4. mkboot -a "hpux boot arguements here" /dev/rdsk/device
5. lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/device
6. lvextend -m 1 /dev/vg00/swaplv /dev/dsk//device
7. repeat lvextend in sequence for all root logical volumes
8. lvlnboot -v ( to update the boot information with the new disk)


See man for each command.

Paula
If you can spell SysAdmin then you is one - anon
George Abraham_1
Regular Advisor

Re: How to mirror another disk to create a three-way mirror.



hai

you can follow the same lines as you did your first mirroring only difference will be use

lventend -m 2 /dev/vg00/lvol1 /dev/dsk/cxtxdx

if the spare disk is cxtydz
1) pvcreate -B /dev/dsk/cxtydz
2)vgextend /dev/vg00 /dev/dsk/cxtydz
3)mkboot /dev/rdsk/cxtydz
4)mkboot -a "hpux -lq(;0)/stand/vmunix" /dev/rdsk/cxtydz
5)lvextend -m 2 /dev/vg00/lvol1 /dev/dsk/cxtydz
6)lvextend -m 2 /dev/vg00/lvol2 /dev/dsk/cxtydz
7) lvextend -m 2 /dev/vg00/lvol3 /dev/dsk/cxtydz
8)lvlnboot -b /dev/vg00/lvol1
9)lvlnboot -s /dev/vg00/lvol2
10)lvlnboot -r /dev/vg00/lvol3
11)lvlnboot -d /dev/vg00/lvol2

12)lvlnboot -R /dev/vg00
13)lvlnboot -v

now here you should see all the 3 disk ...

reboot and you are all set..

keep smiling
george
keep smiling
Gino Castoldi_2
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Hi Paula,

How do I go about mirroring to a brand new disk
that has no data on it. Is the process still the same?

(10 points to any good answer).
Thank you, Gino.
Paula J Frazer-Campbell
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Gino

Sorry the lvextend :-
5. lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/device
6. lvextend -m 1 /dev/vg00/swaplv /dev/dsk//device


Should read :-

5. lvextend -m 2 /dev/vg00/lvol1 /dev/dsk/device
6. lvextend -m 2 /dev/vg00/swaplv /dev/dsk//device

Paula
If you can spell SysAdmin then you is one - anon
A. Clay Stephenson
Acclaimed Contributor

Re: How to mirror another disk to create a three-way mirror.

My best suggestion is to create a 'lifeboat' - this is not precisely a mirror but in some respects it's even better and I always do this before applying patches (and once a week for good measure).

First, it you haven't done it already enable both existing boot to boot without quorum:
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/cXtYdZ

Now let,s make a lifeboat using identical disks via dd:
src=/dev/rdsk/c0t6d0 # adjust to fit your system
DEST=/dev/rdsk/c1t4d0 # ditto

dd if=${SRC} of=${DEST} bs=8000k

Because the filesystems are active, the system does an fsck but I've never had one to fail me.

The idea is that if your boot fails, you remove the boot disk and mirror and insert the 'lifeboat' in the primary boot slot. You are then ready to boot. The lifeboat method protects you from really bad patches and your own stupidity - something that mirrors alone do not. I have a cron that refreshes the lifeboats on my boxes every weekend.


If it ain't broke, I can fix that.
Christopher McCray_1
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Hello,

I wanted to address your O/S recovery portion of your post. If you have to recover (ignite) the system, Ignite doesn't do mirroring, so you would have to re-mirror your vg after the recovery takes place, using the above afore mentioned commands

Chris
It wasn't me!!!!
James R. Ferguson
Acclaimed Contributor

Re: How to mirror another disk to create a three-way mirror.

Hi Gino:

To add a second mirror copy, simply do:

# for X in 1 2 3 4 5 6 7
> do
> lvextend -m 2 /dev/vg00/lvol${X} /dev/dsk/cXtYdZ /dev/dsk/cXtYdZ
> done

Note that vg00's logical volumes 1, 2 and 3 *must* be extended first, in order.

To split a mirror copy, use 'lvsplit'. To rejoin it, use 'lvmerge'. See the man pages for each for some examples.

Regards!

...JRF...
George Abraham_1
Regular Advisor

Re: How to mirror another disk to create a three-way mirror.

hai gino

the process for the new disk is the same...

when you do pvcreate -B the disk is formated..it is like format /s in dos/windows
keep smiling
Jeff Schussele
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Hi Gino,

1)Initialize the 3rd disk
pvcreate /dev/rdsk/cxtydz (may need -f)

2)Add to VG
vgextend vg_name /dev/dsk/cxtydz

3) Extend the LV(s) with the new 3rd mirror
lvextend -m 2 /dev/vg_name/lv_name /dev/dsk/cxtydz
(will need to do for all LVs in the VG)

If this is the mirror of a boot/root disk there several more steps. Sure someone will chime in w/these steps. Else search for "create boot disk mirror".

To reduce the mirror count
lvreduce -m 1 /dev/vg_name/lv_name /dev/dsk/cxtydz
(Again will do for all LVs in VG.)

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Gino Castoldi_2
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Hi Christopher,

I can not use Ignite-UX because we do not have a locally attached tape drive that (I believe anyway) that Ignite-UX requires.
I would prefer to use Ignite-UX if I could.

(10 points to any good answer).
Thank you, Gino.
PIYUSH D. PATEL
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Hi,

I also recommend that you check the new root mirror which you have created by booting the system alone with the mirror disk.

If it doent then the whole purpose of your activity is defeated.

The method suggested by Clay is superb.

Piyush
PIYUSH D. PATEL
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Hi,

One more method : ( Can try out )

1.Remove the mirror disk which is there in your server.

2. Insert the new disk in plae of the old mirror.

3. Boot the system in single user mode ( without quorum checking -lq )

4. Mirror the new hardisk with the procedure defined by others ( with the -m 1 option and not -m 2 option )

5. hence your system will run with the new mirror harddisk and your old mirror harddisk will act as a backup.

Piyush
Gino Castoldi_2
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Hi Clay,

When you perform the 'dd' copy of the system disk I am assuming that you have the system in single user mode first? Wouldn't this be mandatory to get a clean copy of all of the data onto the new scratch disk?

(10 points to any good answer).
Thank you Gino.
George Abraham_1
Regular Advisor

Re: How to mirror another disk to create a three-way mirror.

hai gino

using ignite unix is a good option.. please see this link on using ignite

http://www.docs.hp.com/hpux/onlinedocs/B2355-90750/B2355-90750.html


keep smiling
george
keep smiling
Gino Castoldi_2
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Hi George,

Can we use Ignite-UX even though we do not have a local tape drive attached to the server
itself? I thought that was impossible?
If not let us know.

(10 points to any good answer).
Thank you Gino.
Christopher McCray_1
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

You can set up an ignite server and create "golden images" using make_net_recovery.

Good luck

Chris
It wasn't me!!!!
PIYUSH D. PATEL
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Hi,

You cant use Ignite UX if your system does not have a tape drive.

But yes, you can configure an Ignite server and then take the backup of your server thro make_net_recovery command.

Piyush
George Abraham_1
Regular Advisor

Re: How to mirror another disk to create a three-way mirror.

hai gino

you can take a ignite back up over the network but to recover from the ignite tape you need to boot from the tape.. so you should have a local tape drive to recover...

keep smiling
george
keep smiling
Paula J Frazer-Campbell
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Hi

You can either export from another server a tape drive and mount it and then use make_tape_recovery to the mounted drive, or make_net_recovery to store the image on another server.

See man make_tape_recovery and make_net_recovery.


This command will do your vg00 - but piint it to the mount dir if you use that option.



/opt/ignite/bin/make_tape_recovery -x inc_entire=vg00 -I -v -a /dev
/rmt/1mn


HTH

Paula
If you can spell SysAdmin then you is one - anon
A. Clay Stephenson
Acclaimed Contributor

Re: How to mirror another disk to create a three-way mirror.

In making 'lifeboats', I never bother to drop the boxes to single-user. It is certainly true that because the filesystems are active, you do not get a 'clean' system but it's always been 'good enough' that the system can boot. The necessary fsck's are invoked automatically.
Remember, your really critical filesystems, /stand and / are essentially static. I do try to pick times when the box is relatively quiet. For me, 0300 Sunday's are good.

Being paranoid, I also use mirrors and Ignite but the beauty of a 'lifeboat' is that you can have a server backup in minutes - much faster than Ignite.


If it ain't broke, I can fix that.
Paula J Frazer-Campbell
Honored Contributor

Re: How to mirror another disk to create a three-way mirror.

Hi

You can either export from another server a tape drive and mount it and then use make_tape_recovery to the mounted drive, or make_net_recovery to store the image on another server.

See man make_tape_recovery and make_net_recovery.


This command will do your vg00 - but point it to the mount dir if you use that option.



/opt/ignite/bin/make_tape_recovery -x inc_entire=vg00 -I -v -a /dev
/rmt/1mn


HTH

Paula
If you can spell SysAdmin then you is one - anon
Donald Kok
Respected Contributor

Re: How to mirror another disk to create a three-way mirror.

This is what the Hardware-Engineers from HP do when they replace a defect disk:

Vgcfgrestore ???n /dev/vg00 /dev/rdsk/c2t5d0
Mkboot /dev/rdsk/c2t5d0
Mkboot ???a ??????hpux(;0)/stand/vmunix??? /dev/rdsk/c2t5d0
Vgchange ???a y vg00
Vgsync vg00 &

(ofcourse /dev/rdsk/c2t5d0 is the replaced disk )

It is much less typing, but the copying goes faster too.

HTH
Donald
My systems are 100% Murphy Compliant. Guaranteed!!!