1848683 Members
7958 Online
104035 Solutions
New Discussion

Mirrorng root disk

 
Amit Manna_6
Regular Advisor

Mirrorng root disk

Can anybidy send me the step by step procedure for mirroring root disk please ASAP,
18 REPLIES 18
James R. Ferguson
Acclaimed Contributor

Re: Mirrorng root disk

Hi:

# pvcreate -B /dev/rdsk/cXtYdZ
# vgextend /dev/vg00 /dev/dsk/cXtYdZ
# mkboot /dev/rdsk/cXtYdZ
# mkboot -a "hpux -lq" /dev/rdsk/cXtYdZ
# for LV in 1 2 3 4 5 6 7 8
> do
> lvextend -m 1 /dev/vg00/lvol${LV} /dev/dsk/cXtYdZ
> done
# lvlnboot -v

# mkboot -a "hpux -lq" /dev/rdsk/cXtYdZ #...or original volume, too...
# setboot -a [alternate_path] #...for new mirror...
# lifcp /dev/rdsk/xCtYdZ:AUTO - #...copy to stdout for verification...

Regards!

...JRF...
LiPEnS
Valued Contributor

Re: Mirrorng root disk

Hi
this is example for PA-RISC machine(existing root disk - c0t6d0, mirror root disk - c3t6d0, logical volumes on vg00 group - lvol1, lvol2, lvol3, lvol4, lvol5)

step 1
pvcreate -B /dev/rdsk/c3t6d0
step 2
vgextend /dev/vg00 /dev/dsk/c3t6d0
step 3
mkboot /dev/rdsk/c3t6d0
step 4
mkboot -a "hpux -lq" /dev/rdsk/c3t6d0
step 5
mkboot -a "hpux -lq" /dev/rdsk/c0t6d0
step 6
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c3t6d0
step 7
setboot -a h/w path
Rick Garland
Honored Contributor

Re: Mirrorng root disk

Mirror the boot disk
---------------------------------

Here is a procedure for setting mirroring that also covers setting the boot disk.


pvcreate -B /dev/rdsk/c1t0d0 #use real disk

mkboot -l /dev/rdsk/c1t0d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c1t0d0 # use real disk


# mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?

If you are running 64-bit OS:

# mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?


vgextend /dev/vg00 /dev/dsk/c1t0d0 # same thing
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0

# real disk. repeat for other lvols

lvlnboot -r /dev/vg00/lvol3 # root fs /
lvlnboot -s /dev/vg00/lvol2 #swap
lvlnboot -d /dev/vg00/lvol2 #swap/dump
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R
lvlnboot -v
setboot
setboot -a 52.1.0 # second disk



How to create a Mirrored Boot Disk on PA-RISC Systems - Cookbook


Date: 1/8/01
Document description: How to create a Mirrored Boot Disk on PA-RISC Systems - Cookbook
Document id: LVMKBRC00005103


How to create a Mirrored Boot Disk on PA-RISC Systems - Cookbook
DocId: LVMKBRC00005103 Updated: 3/15/05 7:48:00 AM
PROBLEM

By using mirror copies of the root or primary swap logical volumes on another disk, I will be able to use the copies to keep my system in operation, if either of these logical volumes fail.

How can I create a mirrored boot disk?
CONFIGURATION
HP-UX 10.x, 11.x on PA-RISC
LVM
MirrorDisk-UX
RESOLUTION

NOTE: This cookbook describes the necessary steps to create a mirrored boot disk on PA-RISC systems. This procedure is not applicable to Itanium systems. Refer to KBRC00011156 (Mirroring LVM Root Disk On Itanium Systems) or KBRC00014526 (How to mirror vg00 using LVM on IA with 11.23).

NOTE: The HP MirrorDisk-UX product is a prerequisite for the following procedure. You can check that MirrorDisk-UX is installed in the following way

# swlist -l fileset | grep -i mir

which should return the LVM-MIRROR- RUN fileset:

LVM.LVM-MIRROR-RUN B.11.11 LVM-MIRROR-
RUN

A WORD TO PATCHES:

Do not use LVM commands patches PHCO_24809 (HP-UX 11.11) or PHCO_24645 (HP-UX 11.0). These patches introduced behavior that can result in potential corruption of the Boot Data Reserved Area (BDRA) of a bootable volume group configured with alternate links.

Do not use HP-UX 11.0 mkboot patch PHCO_20869, because it delivers a dynamically linked version of /sbin/mkboot, instead of a statically linked version of the file. Remove this patch and install the previous mkboot patch, PHCO_19656.

In this example, the disk to be used as an additional mirror copy will be /dev/dsk/c0t5d0, which will include the boot, root, and the swap logical volumes. The primary mirror copy will be on /dev/dsk/c0t6d0.

1. Add a bootable LVM disk. Create a physical volume using pvcreate with the -B option.

# pvcreate -B /dev/rdsk/c0t5d0

Refer to LVMKBRC00006255 if pvcreate errors with "The physical volume already belongs to a volume group."

2. Add the physical volume to the existing root volume group with vgextend:

# vgextend /dev/vg00 /dev/dsk/c0t5d0

3. Use mkboot to place boot utilities in the boot area:

# mkboot -l /dev/rdsk/c0t5d0

Use mkboot to add an AUTO file in boot LIF area:

# mkboot -a "hpux" /dev/rdsk/c0t5d0

Or, use the -lq option to allow the system to boot in the event that one of the disks is unavailable, resulting in a loss of quorum.

# mkboot -a "hpux -lq" /dev/rdsk/c0t5d0

NOTE: Use the -lq option when the root volume group contains only 2 disks. If more than 2 disks are in the root volume group, the -lq option is not needed as quorum will be maintained even if 1 disk fails.

Check the contents of the AUTO file with

# lifcp /dev/rdsk/c0t5d0:AUTO -

Alternatively, one could set the alternate boot path variable according to for example

# setboot -a 8/0/19/0.5.0

The hardware address of the disk that will become the mirror disk can be determined with 'ioscan -fnC disk'. To check, use setboot without any arguments.

If desired, activate autosearch and autoboot by

# setboot -s on -b on

4. Use pvdisplay -v to note the sequence of the logical volumes on the primary disk.

# pvdisplay -v /dev/dsk/c0t6d0

NOTE: In the following, the standard sequence lvol1, lvol2, lvol3, and so forth, is assumed.

Create mirror copies of the boot logical volume, primary swap logical volume, root logical volume, and other logical volumes as needed, in the correct sequence

# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c0t5d0
# lvextend -m 1 (additional LV)

Use pvdisplay -v to check the correct sequence of the logical volumes on the mirror disk.

# pvdisplay -v /dev/dsk/c0t5d0

5. Update all physical volumes in the volume group so that the logical volume become the root, boot, primary swap, or a dump volume when the system is next booted:

For HP-UX 10.20 (not updated to) and 11.X only:

# lvlnboot -r /dev/vg00/lvol3 /dev/vg00
# lvlnboot -b /dev/vg00/lvol1 /dev/vg00
# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
# lvlnboot -d /dev/vg00/lvol2 /dev/vg00

With LVM commands cumulative patches newer than PHCO_24809 (11.11) or PHCO_24645 (11.0) and configured alternate links (check with /usr/sbin/lvlnboot -v | grep "alternate link") use additionally

# lvlnboot -R

to recover missing links immediately.

For HP-UX 10.01, 10.10, and updates to 10.20 only:

# lvlnboot -r /dev/vg00/lvol1 /dev/vg00
# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
# lvlnboot -d /dev/vg00/lvol2 /dev/vg00

Check with

# lvlnboot -v

Both disks must be listed for root, boot and swap definitions.

NOTE: Without the lvlnboot sequence the system will not be able to boot automatically if the primary disk fails.

In order to correct it then, the system will have to be booted into LVM maintenance mode.

6. In order to test the mirror configuration, shut down the system and boot from the mirror disk.

# shutdown -ry 0

The system will shut down and reboot. As the system starts to come back up, look for the message (system's output may vary):

TO INTERRUPT THE BOOT SEQUENCE, PRESS ...

Interrupt the boot sequence. This will display the Boot Admin display. At the boot_admin> prompt type:

bo Mirror_disk_hardware_address or
bo alt

if the alternate boot device has been configured. The system will prompt to interact with IPL, answer 'no', and the system will boot from the mirror root disk.

NOTE: This example includes creating a mirror copy of the primary swap logical volume. The primary swap mirror does not need to be on a specific disk or at a specific location, but it does need to be allocated on contiguous disk space. The recommended mirror policy for primary swap is to have the Mirror Write Cache and the Mirror Consistency Recovery mechanisms disabled.

When primary swap is mirrored and your primary swap device also serves as a dump area, you must make sure that Mirror Write Cache and Mirror Consistency Recovery is set to off at boot time to avoid loss of your dump. To reset these options, you will need to reboot your system in maintenance mode. Typically, you will have to interrupt the boot process, affirm the interaction with IPL, and boot by typing hpux -lm. If you need to know how to boot any system in LVM maintenance mode or other mode, please refer to document OZBEKBRC00000607. Then activate the Root Volume Group manually i.e. vgchange -a y vg00. Then use the lvchange(1M) command with the -M n and -c n options. reboot the system.



NOTE: To mirror 2 root disks to another 2 disks:

# pvcreate -B /dev/rdsk/disk1

# pvcreate /deav/rdsk/disk2

# vgextend /dev/vg00 /dev/dsk/disk1 /dev/dsk/disk2

# mkboot -l /dev/rdsk/disk1

# mkboot -a "hpux -lq" /dev/rdsk/disk1

# lifcp /dev/rdsk/disk1:AUTO -

# setboot -a 8/0/19/0.5.0 (disk1 here)

# setboot -s on -b on

# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/disk1

# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/disk1

# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/disk1

# lvextend -m 1 (additional LV) /dev/dsk/disk1 /dev/dsk/disk2

# lvlnboot -R

# pvdisplay -v /dev/dsk/disk1 ---> to check the correct sequence of the logical volumes on the mirror disk.

# pvdisplay -v /dev/dsk/disk2 ---> to check the correct sequence of the logical volumes on the mirror disk.

Make sure disk1 shows up as a boot disk and shows lvol1, lvol2 and lvol3. Then test booting from the mirror disk.

Installation of Offline Diagnostics (ODE) on Mirrored Boot Disks

The following hardware support tools are distributed on the Support Plus Media in the OnlineDiag swinstall bundle:

* Support Tools Manager (STM)
* EMS Hardware Monitors
* HP Predictive Support tools (Series 800 only)
* LIF-resident offline diagnostics (ODE)

There is an easy way to install the ODE to the mirror if you have already installed the OnlineDiag bundle.

First, check if your system is a pure 64 bit system:

# getconf HW_CPU_SUPP_BITS

The result is either 32, 32/64 or 64. If the system is a pure 64 bit systems (e.g. N-Class) the result is 64.

Check the existence of the updatediaglif and updatediaglif2 files:

# ll /usr/sbin/diag/lif/updatediaglif*

-r--r--r-- 1 bin bin 848896 May 7 17:29 /usr/sbin/diag/lif/updatediaglif
-r--r--r-- 1 bin bin 865280 May 7
17:29 /usr/sbin/diag/lif/updatediaglif2

We will use the updatediaglif2 file only for pure 64 bit systems (e.g. N-Class). For 32 bit systems or systems that support both CPU types (e.g K-Class) we use the updatediaglif file.

List the contents of the LIF directory of the mirror:

# lifls -l /dev/rdsk/c0t5d0

volume ISL10 data size 7984 directory size 8 96/05/28 04:10:13
filename type start size implement created
===============================================================
ISL -12800 584 240 0 96/05/28 04:10:13
AUTO -12289 824 1 0 96/05/28 04:10:13
HPUX -12928 832 848 0 96/05/28 04:10:13
PAD -12290 1680 1652 0 96/05/28 04:10:14
LABEL BIN 3336 8 0 99/01/25 06:00:41

Install the ODE LIF files with mkboot and protect (-p) the existing LIF files which you detected with lifls as described above.

For 32 bit and systems that support both 32 and 64 bit:

# mkboot -b /usr/sbin/diag/lif/updatediaglif \
-p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c0t5d0

For pure 64 bit systems:

# mkboot -b /usr/sbin/diag/lif/updatediaglif2 \
-p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c0t5d0

Check with

# lifls /dev/rdsk/c0t5d0

One will find additional LIF files.

volume ISL10 data size 7984 directory size 8 96/05/28 04:10:13
filename type start size implement created
===============================================================
ODE -12960 584 880 0 03/05/06 20:27:48
MAPFILE -12277 1464 128 0 03/05/06 20:27:48
SYSLIB -12280 1592 353 0 03/05/06 20:27:48
CONFIGDATA -12278 1952 249 0 03/05/06 20:27:48
SLMOD -12276 2208 133 0 03/05/06 20:27:48
SLDEV -12276 2344 204 0 03/05/06 20:27:48
SLDRIVERS -12276 2552 496 0 03/05/06 20:27:48
SLSCSI -12276 3048 117 0 03/05/06 20:27:48
MAPPER -12279 3168 234 0 03/05/06 20:27:48
IOTEST -12279 3408 208 0 03/05/06 20:27:48
PERFVER -12279 3616 198 0 03/05/06 20:27:48
PVCU -12801 3816 64 0 03/05/06 20:27:48
SSINFO -12286 3880 2 0 03/05/06 20:27:48
...
Popy
Regular Advisor

Re: Mirrorng root disk

Amit,

Just to add to the above answers...You need not do all these things in case you are replacing a failed disk which was mirrored (Most of the time sysadmins come acrose with this ).Restoring a vgcfg backup and vgsync will do all the things for u in this case......

Cheer's
Raneesh Vijayan
Amit Manna_6
Regular Advisor

Re: Mirrorng root disk

I am getting following error.

root@aramis:>lvextend -m 1 /dev/vg00/lvol_root /dev/dsk/c100t0d0
lvextend: Not enough free physical extents available.
Logical volume "/dev/vg00/lvol_root" could not be extended.
Failure possibly caused by strict allocation policy
Failure possibly caused by strict allocation policy

Please help.
Rick Garland
Honored Contributor

Re: Mirrorng root disk

The disk you are trying to mirror to, is it same size? Smaller?
LiPEnS
Valued Contributor

Re: Mirrorng root disk

We really need more information. What does an "lvdisplay -v /dev/vg00/lvol_root" show? What does a "vgdisplay -v /dev/vg00" show?What does a "pvdisplay -v /dev/dsk/c100t0d0" show?
saju_2
Respected Contributor

Re: Mirrorng root disk

Message (lvextend):
lvextend: Not enough physical extents available.
Logical volume "/dev/vgname/lvname" could not be extended.
Failure possibly caused by strict allocation policy
Cause 1
There is not enough space in the volume group to extend the logical volume to the requested size. This is
typically caused by one of three situations:
a. There are not enough free physical extents in the volume group. Run vgdisplay to confirm how many
physical extents are available, and multiply that by the extent size to determine the free space in the
volume group.

Cause 2:

The logical volume is mirrored with a strict allocation policy, and there are not enough extents on a
separate disk to comply with the allocation policy. To confirm this, run lvdisplay to determine which disks
the logical volume occupies, and then check if there is sufficient space on the other disks in the volume
group.

Cause 3:

In a SAN environment, one of the disks was dynamically increased in size. LVM does not detect the
asynchronous change in size.

Regards
CS
Amit Manna_6
Regular Advisor

Re: Mirrorng root disk

HI,
The output of lvdisplay,vgdisplay and pvdisplay is attached.

LiPEnS
Valued Contributor

Re: Mirrorng root disk

not:
root@aramis:>lvextend -m 1 /dev/vg00/lvol_root /dev/dsk/c100t0d0

but:
root@aramis:>lvextend -m 1 /dev/vg00/lvol_root /dev/dsk/c101t0d0

!! c101t0d0
Torsten.
Acclaimed Contributor

Re: Mirrorng root disk

Your lvols are on c100t0d0. Device c101t0d0 is free. Use this to extend the lvols to.


root@aramis:>lvextend -m 1 /dev/vg00/lvol_root /dev/dsk/c101t0d0

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!   
Steven E. Protter
Exalted Contributor

Re: Mirrorng root disk

My version of the earlier guides:

pvcreate -B /dev/rdsk/c1t0d0 #use real disk

mkboot -l /dev/rdsk/c1t0d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c1t0d0 # use real disk


# mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?

If you are running 64-bit OS:

# mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?


vgextend /dev/vg00 /dev/dsk/c1t0d0 # same thing
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0

# real disk. repeat for other lvols

lvlnboot -r /dev/vg00/lvol3 # root fs /
lvlnboot -s /dev/vg00/lvol2 #swap
lvlnboot -d /dev/vg00/lvol2 #swap/dump
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R
lvlnboot -v
setboot
setboot -a 52.1.0 # second disk

Note: That you need to do every step of this from the commmand line. SAM does not always follow logical rules for assignment.

I also suggest that you make a plan on paper or spreadsheet for how you want you lvm configuration to end up. It helps avoid doing the work three or four times.

also agree with the analysis of the two posts commenting in vgdisplay output.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Amit Manna_6
Regular Advisor

Re: Mirrorng root disk

Hi,
Which logocal volume should be used with lvlnboot -b option?

And after lvlnboot -R what are steps we need to do?
Amit Manna_6
Regular Advisor

Re: Mirrorng root disk

Also, how to check if the mirrored root disk has been set up ok.
Alan Meyer_4
Respected Contributor

Re: Mirrorng root disk

The LV to use for the boot area, lvlnboot -b, is the logical volume that /stand resides upon. Usually it's lvol1. Also, make sure that when you create the mirror, make sure that the boot LV is the first one to be mirrored so it is first on the disk.

you can check the boot configuration by using the lvlnboot -v command.
" I may not be certified, but I am certifiable... "
Alan Meyer_4
Respected Contributor

Re: Mirrorng root disk

you can also use pvdisplay -v /dev/dsk/c?t?d? to check to see it the boot LV is first on the disk.
" I may not be certified, but I am certifiable... "
Nguyen Anh Tien
Honored Contributor

Re: Mirrorng root disk

Firstly. pls assign point to which you think it is valuable for you
THIS IS WHAT YOU NEED
CREATE MIRROR BOOT DISK ON HP-UX

1. Add a bootable LVM disk. Create a physical volume using pvcreate with the -B option.
# pvcreate -B /dev/rdsk/c0t5d0
2. Add the physical volume to the existing root volume group with vgextend:
# vgextend /dev/vg00 /dev/dsk/c0t5d0
3. Place the boot utilities in boot areas
# mkboot -l /dev/rdsk/c0t5d0
use the -lq option to allow the system to boot in the event that one of the disks is unavailable, resulting in a loss of quorum.
# mkboot -a "hpux -lq" /dev/rdsk/c0t5d0
NOTE: Use the -lq option when the root volume group contains only 2 disks. If more than 2 disks are in the root volume group, the -lq option is not needed as quorum will be maintained even if 1 disk fails.
4. Check the contents of the AUTO file with
# lifcp /dev/rdsk/c0t5d0:AUTO -
Alternatively, one could set the alternate boot path variable according to for example
Create mirror copies of the boot logical volume, primary swap logical volume, root logical volume, and other logical volumes as needed, in the correct sequence
# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c0t5d0
# lvextend -m 1 (additional LV)
5. Update all physical volumes in the volume group so that the logical volume become the root, boot, primary swap, or a dump volume when the system is next booted:
For HP-UX 10.20 (not updated to) and 11.X only:
# lvlnboot -r /dev/vg00/lvol3 /dev/vg00
# lvlnboot -b /dev/vg00/lvol1 /dev/vg00
# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
# lvlnboot -d /dev/vg00/lvol2 /dev/vg00
# setboot -a 8/0/19/0.5.0 â s on â b on
HP is simple
Devender Khatana
Honored Contributor

Re: Mirrorng root disk

Hi,

The outputs attached by you shows that your disk has some free LEs at the end of the disk. root being one of three first OS LVOL shall be allocated at the starting of the disk. The allocation shall be in sequence

1. LVOL1 ( Here lvol_stand)
2. LVOL2 (Here swap)
3. LVOL3 (Here lvol_root)

The LVOLs shall be mirroed in sequence first before proceeding with mirroring any other LVOLs. But you are mirroring root in the end which will not do. I also see that the first copy of lvol_root is allocated at the end of the disk and can cause in booting the system.

Also we see only 26 continuous PE's available at the end of disk. Are other 11 available in sequence there itself. This is necessary as all LE's for root in a VG shall be contiguous.

Also it appears that the system is choked of disk space. You are trying to use two OS disks as data disks and that too with mirroed configuration which is making the scenatio more complexed.

What is the use of the system?

HTH,
Devender
Impossible itself mentions "I m possible"