1833791 Members
2993 Online
110063 Solutions
New Discussion

mirror vg00

 
SOLVED
Go to solution
Jeffrey F. Goldsmith
Super Advisor

mirror vg00

I am in need of help mirroring the drives in vg00 on my rp3440. I am currently running HP-UX 11.iv2 and when I checked the installed software it shows that mirrorDisk (B2491BA) is installed. How do I use this to mirror the drives?

Thanks for the help.
10 REPLIES 10
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: mirror vg00

First, you need to identify the drive you want to use as a mirror.

Now a script like this one should do the trick:

RAW=/dev/rdsk/c1t5d0 # your new mirror
COOKED=/dev/dsk/c1t5d0 # ditto
LVOLS="lvol1 lvol2 lvol3 lvol4 lvol5 lvol6 lvol7 lvol8" # match your existing vg00 LVOL's

pvcreate -f -B ${RAW}
vgextend /dev/vg00 ${COOKED}
mkboot ${RAW}
mkboot -a "hpux -lq (;0)/stand/vmunix" ${RAW}

for LVOL in ${LVOLS}
do
echo "Mirroring /dev/vg00/${LVOL}"
lvextend -m 1 /dev/vg00/${LVOL}
done

lvlnboot -R

You should also run the

mkboot -a "hpux -lq (;0)/stand/vmunix" original_boot_disk

command because otherwise you actually make you box less likely to boot unattended because now both disks must be present to boot off the primary.
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: mirror vg00

Shalom Jeffery,


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:

# This section may be different for 11i v2


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

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
Jeffrey F. Goldsmith
Super Advisor

Re: mirror vg00

Here is my disk drive information. I have two drives in my server at this location:

/dev/dsk/c2t0d0
/dev/dsk/c2t1d0

After reading both suggestions I tried to do the following and it seemed to work fine. Meaning I didnt get any errors.

Pvcreate â B /dev/rdsk/c2t1d0
Mkboot â l /dev/rdsk/c2t1d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c2t1d0
mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c2t1d0
mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c2t1d0


If my understanding is correct I should be doing the following steps. If you see any problems with this please let me know.

vgextend /dev/vg00 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/depot /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t1d0

lvlnboot -r /dev/vg00/lvol3
lvlnboot -s /dev/vg00/lvol2
lvlnboot -d /dev/vg00/lvol2
lvlnboot -b /dev/vg00/lvol1
lvlnboot â R
lvlnboot â v


Where do i get the setboot information from?

Thanks.
James R. Ferguson
Acclaimed Contributor

Re: mirror vg00

Hi Jeffrey:

Your last post suggests an error. You should mirror your logical volumes at least beginning in this order:

'lvol1', 'lvol2, 'lvol3'

You *do* want to mirror your primary swap space. After all, you need that to boot and if your primary disk fails, you want the mirrored copy to boot correctly.

With regard to the 'setboot', yes, be sure to set the alternate boot path after you mirror. Again, you want the secondary disk to automatically bring your server up.

# setboot -a

See the manpages for more information.

Regards!

...JRF...
Jeffrey F. Goldsmith
Super Advisor

Re: mirror vg00

Thanks for the warning. This is the info i get when i do a bdf. Dont see an lvol2 listed. Since this server arrived preloaded do I need to create an lvol2?


root: /etc/default ==> bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 524288 197544 324248 38% /
/dev/vg00/lvol1 298928 97592 171440 36% /stand
/dev/vg00/lvol8 4718592 780616 3907264 17% /var
/dev/vg00/lvol7 3538944 1604424 1919432 46% /usr
/dev/vg00/lvol4 212992 8616 202848 4% /tmp
/dev/vg00/depot 2048000 16974 1904094 1% /software
/dev/vg00/lvol6 2719744 2049512 665008 76% /opt
/dev/vg00/lvol5 32768 11448 21200 35% /home
/dev/dsk/c0t0d0 50880 50880 0 100% /cdrom
root: /etc/default ==>
James R. Ferguson
Acclaimed Contributor

Re: mirror vg00

Hi (again) Jeffrey:

No, you won't see '/dev/vg00/lvol2' in a 'bdf' output nor should you record it in 'etc/fstab'. Primary swap is automatically "mounted" at bootup. In fact, if you put it in 'etc/fstab', the next time a 'mount all' was done you see the kernel "complain".

You *can* see it, however, if you do:

# swapinfo -tam

This shows *all* of your current swap devices along with a line for "memory" if you have pseudoswap enabled (you should, but that's a whole other subject).

If you fail to mirror the first three logical volumes of vg00 in the order (1,2,3) then if you do:

# lvlnboot -v

...to see that all is in order, it will appear that the primary swap space (lvol2) isn't mirrored and you won't be able to correct it!

Regards!

...JRF...
Regards!

...JRF...
Jeffrey F. Goldsmith
Super Advisor

Re: mirror vg00

James,

Thanks for the info. I did everything the way I had it listed above with the one exception of doing an lvextend on lvol2 after lvol1 and before lvol3. Here is the lvlnboot -v info.

root: /dev/vg00 ==> lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c2t0d0 (0/1/1/0.0.0) -- Boot Disk
/dev/dsk/c2t1d0 (0/1/1/0.1.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c2t0d0
/dev/dsk/c2t1d0
Root: lvol3 on: /dev/dsk/c2t0d0
/dev/dsk/c2t1d0
Swap: lvol2 on: /dev/dsk/c2t0d0
/dev/dsk/c2t1d0
Dump: lvol2 on: /dev/dsk/c2t0d0, 0

root: /dev/vg00 ==>


Does this look correct? The only thing I havent done is the setboot. When I do a setboot this is what i get.

root: /dev/vg00 ==> setboot
Primary bootpath : 0/1/1/0.0.0
Alternate bootpath : 0/0/2/0.3.0

Autoboot is ON (enabled)
Autosearch is ON (enabled)


Is this the correct command for setboot?

setboot -a 0/1/1/0.1.0

or is it

setboot -a 01.1.0.1.0

Here is the ioscan -fnC disk info for those two drives.

disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 73.4GST373454LC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
disk 2 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 73.4GST373454LC
/dev/dsk/c2t1d0 /dev/rdsk/c2t1d0
James R. Ferguson
Acclaimed Contributor

Re: mirror vg00

Hi Jeffrey:

The 'lvlnboot' output looks good (showing both disk for each logical volume), but to be safe, since you say you didn't mirror in the "1,2,3" order, do:

# for N in 1 2 3 4 5 6 7 8
> do
> 'vgreduce -m 0 /dev/vg00/lvol${N} /dev/dsk/c2t1d0
done

# vgreduce -m 0 /dev/vg00/depot /dev/dsk/c2t1d0

...and then mirror everything back in order.

Your setboot command should look like:

# setboot -a 0/1/1/0.1.0

The best test of your exercise is to boot from the mirrored disk.

Regards!

...JRF...
Jeffrey F. Goldsmith
Super Advisor

Re: mirror vg00

James,

I did do the the lvextend for the lvol1 - lvol8 in order. Earlier I had asked about doing them prior to doing the lvextends. That means that everything should be fine correct? Here is the listing of the lvextends:


root: /dev/vg00 ==> vgextend /dev/vg00 /dev/dsk/c2t1d0
Volume group "/dev/vg00" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
root: /dev/vg00 ==> lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t1d0
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol1" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
root: /dev/vg00 ==> lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t1d0
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol2" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
root: /dev/vg00 ==> lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t1d0
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
root: /dev/vg00 ==> lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t1d0
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol4" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
root: /dev/vg00 ==> lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t1d0
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol5" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
root: /dev/vg00 ==> lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t1d0
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol6" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
root: /dev/vg00 ==> lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t1d0
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol7" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
root: /dev/vg00 ==> lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t1d0
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol8" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf


One question I do have with doing this mirroring. If there are other lvol's on the vg00 primary drive and I dont extend them onto the second/mirror drive can i still do that at a later date?
James R. Ferguson
Acclaimed Contributor

Re: mirror vg00

Hi Jeffrey:

You asked, "If there are other lvol's on the vg00 primary drive and I dont extend them onto the second/mirror drive can i still do that at a later date?".

The answer is "yes.". All that I was trying to urge is, why wouldn't you want to mirror every logical volume in your vg00 disk? After all, the goal is high-availability and that means everything possible is ready on a mirror copy when/if you need it!

Regards!

...JRF...