1833695 Members
3653 Online
110062 Solutions
New Discussion

mirroring the root disk

 
SOLVED
Go to solution
d.yoman
Advisor

mirroring the root disk

I have a 146GB root disk. It needs to be mirrored with another disk of same capacity. There are around 15 lvols that include standard lvols created by OS and secondary swap and some data related lvols. I want to know which lvols should be mirrored in exact sequence. also want to know what problems may be faced if lvols dont have staring PE same on the mirrored disk. Any additional precautions to be taken while mirroring the disk. The do's and don'ts .
18 REPLIES 18
Pete Randall
Outstanding Contributor
Solution

Re: mirroring the root disk

First the procedure:

1. Create a physical volume with a boot reserved area
"pvcreate -B /dev/rdsk/c1t6d0"

2. Add the physical volume to the root VG
"vgextend /dev/vg00 /dev/dsk/c1t6d0"

3. Use mkboot to place the boot utilities in the boot area and add the AUTO file

"mkboot /dev/rdsk/c1t6d0"
"mkboot -a "hpux -lq" /dev/rdsk/c1t6d0"

4. Use mkboot to update the AUTO file on the primary boot disk
"mkboot -a "hpux -lq" /dev/rdsk/c0t6d0"

5. Mirror the stand, root and swap logical volumes
"lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t6d0"
"lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c1t6d0"
"lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c1t6d0"

6. Modify your alternate boot path
"setboot -a 8/8.6.0 # use the path of your new boot disk"

7. Edit /stand/bootconf and add your new mirrored boot disk.

That's all there is to it. You may notice that I left out any
lvlnboot commands. That is because they are not
necessary - see the man page:

"This command should be run in recovery mode (-R)
whenever the configuration of the root volume group is
affected by one of the following commands: lvextend,
lvmerge, lvreduce, lvsplit, pvmove, lvremove, vgextend,
or vgreduce (see lvextend(1M), lvmerge(1M), lvreduce(1M),
lvsplit(1M), pvmove(1M), lvremove(1M), vgextend(1M), and
vgreduce(1M)). Starting with HP-UX Release 10.0, this is
done automatically."


Then the recommendations:

I would mirror all your logical volumes. I would prefer to keep my data separate from my root OS lvols, but if that is not possible, make sure everything is mirrored so you are protected in case of disk failure.


Pete

Pete
Jeff_Traigle
Honored Contributor

Re: mirroring the root disk

The only requirement is that lvol1 through lvol3 be mirrored first, in that order. Beyond that, it doesn't matter.
--
Jeff Traigle
Torsten.
Acclaimed Contributor

Re: mirroring the root disk

@Pete:

Sorry, there is more than PA-RISC in this world.

If you have an Integrity (Itanium) server, the procedure is different.
If you have a PA-RISC based server, follow Petes advise.

please post the output of

# model

The Itanium procedure is here:

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000082066576

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!   
d.yoman
Advisor

Re: mirroring the root disk

Pete,
If lvol5 is mirrored before lvol4 what could happen is reality?
Suppose i have lvol10 and lvol11 that doesnt need mirroring so i mirror lvol12 and lvol13 now. If future i need to mirror lvol10 and 11 then is it ok ? Because the sequence of lvols on the mirrored disk would be lvol1,2,3,4,5,6,7,8,9,12,13 and then 10 and 11. Please explain
James George_1
Trusted Contributor

Re: mirroring the root disk

Hi

Since it is the root disk and you have the same capacity disk available for mirroring , it is better to mirror all the LVs. Here is the procedure to mirror the root disk.

# pvcreate -fB /dev/rdsk/cxtxd0
# mkboot -l /dev/rdsk/cxtxd0
# mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/cxtxd0
# lifcp /dev/rdsk/cxtxd0:AUTO -
# vgextend /dev/vgXX /dev/dsk/cxtxd0

# bdf ( see how many Lvs you have , also take the swap LVs also and use the same number of lvs in the loop script below)

Here is a small loop script to mirror all the LVs..

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

#lvlnboot â R



forum is for techies .....heaven is for those who are born again !!
James George_1
Trusted Contributor

Re: mirroring the root disk

Hi

Since it is the root disk and you have the same capacity disk available for mirroring , it is better to mirror all the LVs. Here is the procedure to mirror the root disk.

# pvcreate -fB /dev/rdsk/cxtxd0
# mkboot -l /dev/rdsk/cxtxd0
# mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/cxtxd0
# lifcp /dev/rdsk/cxtxd0:AUTO -
# vgextend /dev/vgXX /dev/dsk/cxtxd0

# bdf ( see how many Lvs you have , also take the swap LVs also and use the same number of lvs in the loop script below)

Here is a small loop script to mirror all the LVs..

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

#lvlnboot â R


Good Luck

James

forum is for techies .....heaven is for those who are born again !!
d.yoman
Advisor

Re: mirroring the root disk

Thanks to all of you but please reply to my comment above and lets talk about the DON't s and their effect.
Patrick Wallek
Honored Contributor

Re: mirroring the root disk

As said above, the order ONLY realy matters for LVOL's 1, 2 and 3.

The other LVOLs can be mirrored in any order. It really does not matter. I don't know of any performance penalty. HP-UX keeps track of the PE's for the mirrors. The mirrors do not have to be on the exact same PE's.
Torsten.
Acclaimed Contributor

Re: mirroring the root disk

Again, its essential to take the right procedure.





If you are mirroring an Integrity machine with the procedure for a PA-RISC system, you will get a mirrored disk, but this disk will *NEVER* boot.

Important like suggested by others:

mirror first lvol1, lvol2 and lvol3.

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!   
Pete Randall
Outstanding Contributor

Re: mirroring the root disk

OK, then, for Itanium, the procedure is outlined here:

http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,5343,00.html


Pete

Pete
d.yoman
Advisor

Re: mirroring the root disk

what if lvol14 and lvol 12 are swap partitions and mirrored as lvol14 first and then lvol12
Patrick Wallek
Honored Contributor

Re: mirroring the root disk

It doesn't matter.

For the record though -- Having multiple swap areas on the same disk is not necessarily a good idea. Depending on their priority, if you actually start paging then you could get a serious performance hit and LOTS of head thrashing on the disk if it is trying to write to multiple swap partitions of the same priority.
sheevm
Regular Advisor

Re: mirroring the root disk

hi

I have a question on the same topic.

We have 146gb local disk with all the O.S partitions. I am planning to configure 16GB swap space in one logical volume in the same disk. Is it O.K to have the swap lvol in the same O.S disk?

Thanks.
Raji
be good and do good
d.yoman
Advisor

Re: mirroring the root disk

after say 6 months what should one check so that he can be assured that the failure of a disk wont cause any trouble. i need commands and their expected output and what to concentrate in the output
Patrick Wallek
Honored Contributor

Re: mirroring the root disk

You should have a script that checks for "stale" extents.

vgdisplay -v vg00 |grep stale | wc -l

Ideally that should come back with a count of 0. If it is any other number then one of the LVOLs has stale extents. You could then do an 'lvdisplay -v' on the lvol to see how many extents are stale.

Stale extents generally indicate some sort of disk problem, possibly a bad spot on the disk. If all LVOLs in the VG show stale, then you disk is likely dead.

Torsten.
Acclaimed Contributor

Re: mirroring the root disk

first check, if your disks are both bootable:

e.g.

# lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c1t15d0 (0/0/1/1.15.0) -- Boot Disk
/dev/dsk/c3t15d0 (0/0/2/1.15.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c1t15d0
/dev/dsk/c3t15d0
Root: lvol3 on: /dev/dsk/c1t15d0
/dev/dsk/c3t15d0
Swap: lvol2 on: /dev/dsk/c1t15d0
/dev/dsk/c3t15d0
Dump: lvol2 on: /dev/dsk/c1t15d0, 0

This is indicating a non-bootable pair of vg00 disks:

lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c1t15d0 (0/0/1/1.15.0) -- Boot Disk
/dev/dsk/c3t15d0 (0/0/2/1.15.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c1t15d0
Root: lvol3 on: /dev/dsk/c1t15d0
Swap: lvol2 on: /dev/dsk/c1t15d0
Dump: lvol2 on: /dev/dsk/c1t15d0, 0





Now check the mirror:

# vgdisplay -v|more
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 19
Open LV 19
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4350
VGDA 4
PE Size (Mbytes) 8
Total PE 8680
Alloc PE 7106
Free PE 1574
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg00/lvol1
LV Status available/syncd
LV Size (Mbytes) 152
Current LE 19
Allocated PE 38
Used PV 2
...

# lvdisplay -v /dev/vg03/lvol3|more
--- Logical volumes ---
LV Name /dev/vg03/lvol3
VG Name /dev/vg03
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 8680
Current LE 2170
Allocated PE 4340
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

...



(important for lvdisplay)


Mirror copies 1 - you have 1 mirror copy

LV Status available/syncd - your mirror is syncd

(if you have "stale" you have a problem)

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!   
d.yoman
Advisor

Re: mirroring the root disk

whats the meaining of Allocation : Strict

and

Allocation : Strict / Contiguous

what is the difference?
Patrick Wallek
Honored Contributor

Re: mirroring the root disk

Strict means that you can't mirror an LVOL to the same disk.

Contiguous means that the PE's for an LVOL must be available in one big chunk on the disk. The PE's can't be split up.

LVOL's 1, 2 and 3 (/stand, PRI SWAP and /) MUST be contiguous. Others do not have to be.

Have a look at the lvcreate, lvextend man pages for more information on strict, strict contiguous, etc.