Operating System - HP-UX
1833780 Members
2326 Online
110063 Solutions
New Discussion

How do I mirror 1 Vloume Group which is spread across 2 disks?

 
SOLVED
Go to solution
David Wrisley
Occasional Contributor

How do I mirror 1 Vloume Group which is spread across 2 disks?

I have an HP D390 system, running HP-UX 11.00. I have 2 9 GB disks set up as the "root" system. One is at address 8/4.5 (/dev/dsk/c0t5d0) and the other is at 8/4.9 (/dev/dsk/c0t9d0). I have two identical blank disks at 8/4.8 (/dev/dsk/c0t8d0) and 8/4.10 (/dev/dsk/c0t10d0). I have lvol1 thru 1vol7 setup on vg00 and spread across 8/4.5 and 8/4.9.

These systems are /, /usr, /tmp, /opt,
/stand, /home, and /var. The /usr file system is actually spread across the disks and is using 1200MB of space on 8/4.5 and 800 MB of space on 8/4.9. The other file systems are completely contained on one disk or the other.

I wish to set up a mirror of vg00 on the two empty disks, 8/4.8 and 8/4.10, such that if either 8/4.5 or 8/4.9 fail, the system will still boot and function.

How would I accomplish such a task?
"Just anbother western guy with desires I can't satisfy"
10 REPLIES 10
harry d brown jr
Honored Contributor

Re: How do I mirror 1 Vloume Group which is spread across 2 disks?

You can mirror LV's not VG's. lvextend is the command you want.
Live Free or Die
Ron Cornwell
Trusted Contributor

Re: How do I mirror 1 Vloume Group which is spread across 2 disks?

The easiest way is lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/cXtXdX /dev/dsk/cXtXdX.
Christopher McCray_1
Honored Contributor

Re: How do I mirror 1 Vloume Group which is spread across 2 disks?

I would do an lvdisplay on each lvol to see which disk they reside on, then mirror on the opposite;

#lvextend -m 1 /dev/vg00/lvol? /dev/dsk/otherdisk

I see no reason why that wouldn't work unless you don't have the space. I am, howeve, confused as to why vg00 was set up this way to begin with because if one disk went bad you are still out of luck in most cases.

Hope this helps
Chris
It wasn't me!!!!
Santosh Nair_1
Honored Contributor

Re: How do I mirror 1 Vloume Group which is spread across 2 disks?

As Harry has already mentioned, mirroring happens at the LV level. Add the other disks to the VG using the vgextend command and for each LV in your VG, do a lvextend -m 1 . If you want to get more specific about which disk you want the LV mirrored to, you can do an lvextend -m 1 , but this requires a lot more effort as you need to keep track of which disks are used and how much free space you have.

-Santosh
Life is what's happening while you're busy making other plans
Uday_S_Ankolekar
Honored Contributor

Re: How do I mirror 1 Vloume Group which is spread across 2 disks?


Hi,

Do you have MirrorDisk/Ux software
You can check this with swlist -l bundle and look for above line. If it is there then follow these steps:


# pvcreate -Bf /dev/rdsk/cXtXdX (the disk
you wish to use.
# vgextend /dev/vg00 /dev/dsk/cXtXdX
# mkboot /dev/rdsk/cXtXdX
# mkboot -a "hpux -lq(;0)/stand/vmunix" /dev/rdsk/cXtXdX
# lvlnboot -R
then do lvextend -m for all lvols explained by others ..

Goodluck
-USA..
Good Luck..
Darrell Allen
Honored Contributor

Re: How do I mirror 1 Vloume Group which is spread across 2 disks?

There's a number of threads in the forums for mirroring. Simply search for mirror vg00. One of the threads is http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x247d87dc4d7dd5118ff00090279cd0f9,00.html

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Bernie Vande Griend
Respected Contributor
Solution

Re: How do I mirror 1 Vloume Group which is spread across 2 disks?

1. Create a bootable LVM disk to be used for the mirror.
# pvcreate -fB /dev/rdsk/c0t8d0
# pvcreate -f /dev/rdsk/c0t10d0

2. Add this disk to the current root volume group.
# vgextend /dev/vg00 /dev/dsk/c0t8d0 /dev/dsk/c0t10d0

3. Make the new disk a boot disk.
# mkboot /dev/rdsk/c0t8d0

4. Copy the correct AUTO file into the new LIF area. Note: that's an el not a one in hpux -lq, it means allow the system to boot even if one of the boot drives is unavailable. This is why it's done on both disks.
# mkboot -a "hpux -lq" /dev/rdsk/c0t8d0

5. Mirror the boot, root and primary swap logical volumes to the new
bootable disk. NOTE: The boot logical voluem must be done first to ensure it occupies the first contiguous set of extents on the new disk, so therefore /stand MUST BE MIRRORED FIRST, then swap/dump, and then Root. Specifying the disk afte the lvol name is optional as the system by default will extend to the other drive.
# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t8d0
# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c0t8d0
# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c0t8d0

6. Repeat this for the rest of the logical volumes in vg00, except for the logical volume for /usr. For /usr:
# lvextend -m 1 /dev/vg00/lvol? /dev/dsk/c0t8d0 /dev/dsk/c0t10d0

7. Copy over the lvlnboot information, update the BDRA
# lvlnboot -R /dev/vg00

8. verify the BDRA information for boot, root, primary swap;
# lvlnboot -v

9. If not correct do the following to correct them:
# /usr/sbin/lvlnboot -b /dev/vg00/lvol1
# /usr/sbin/lvlnboot -r /dev/vg00/lvol3
# /usr/sbin/lvlnboot -s /dev/vg00/lvol2
# /usr/sbin/lvlnboot -R /dev/vg00

10. If you made changes in 7, again verify the BDRA:
# lvlnboot -v

11. Verify the volume group has the correct physical volumes now:
# vgdisplay -v vg00

12. Verfiy the logical volumes are mirrored and current:
# lvdisplay -v /dev/vg00/lvol1 # repeat this for each logical volume

13. Verify the physical volume (disk) and that lvol1 is first on the disk:
# pvdisplay -v /dev/dsk/c0t8d0

14. Verify the LIF area and AUTO files on the disks
# lifls /dev/rdsk/c0t8d0

15. To change the alternate boot device: (or it can be done at boot up)
# setboot -a 10/6.0.0 # substitute the actual hardware path

16. You should reboot the system using shutdown -r 0 and verify you can boot to each of the disks.
Ye who thinks he has a lot to say, probably shouldn't.
James R. Ferguson
Acclaimed Contributor

Re: How do I mirror 1 Vloume Group which is spread across 2 disks?

Hi David:

A couple of comments here. First, remember that mirroring is done a software level and involves logical volumes, not physical disks. As you no doubt are aware, you must have purchased the MirrorDisk/UX product to enable mirroring. An excellent guide to setting up mirrors can be found in the "Managing Systems and Workgroups: A Guide for HP-UX System Administrators" manual in the section titled "Managing Mirrored File Systems":

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90742/B2355-90742_top.html&con=/hpux/onlinedocs/B2355-90742/00/00/66-con.html&toc=/hpux/onlinedocs/B2355-90742/00/00/66-toc.html&searchterms=system%7ctrusted&queryid=20011022-114951

Next, I'd recommend re-apportioning your vg00 so that it can be contained in one physical volume, or at least so that filesystems are not split across physical disk. This makes recovery of a failed volume easier. Too, when you mirror the logical volumes, physical extents will need to be mirrored on *different* physical disk. You can use 'pvmove' to shift physical extents between the disks.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: How do I mirror 1 Vloume Group which is spread across 2 disks?

Actually, breaking vg00 into more disks is not a bad idea. In many cases, 2 4GB disks (with their 2 4GB mirrors) is preferable as performance is better though administration is a bit more difficult. If you are really going to do this 'right'; you really need another controller and another disk enclosure so that you can tolerate a contrroller/termination/cabling failure as well.

Anyway here are the steps:

pvcreate -f -B /dev/rdsk/c0t8d0
pvcreate -f /dev/rdsk/c0t9d0
vgextend /dev/vg00 /dev/dsk/c0t8d0
vgextend /dev/vg00 /dev/dsk/c0t9d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c0t8d0

Then for each lvol:
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t8d0

Specify both /dev/dsk/c0t8d0 and /dev/dsk/c0t9d0 for the lvol containing /usr

When you are all done and tested; I would also do the identical mkboot command specifying the old boot disk so that it too will allow boot without quorum.

Clay
If it ain't broke, I can fix that.
G. Vrijhoeven
Honored Contributor

Re: How do I mirror 1 Vloume Group which is spread across 2 disks?

Hi david.

On the first place you want to have your mirror disks on an other controller so if the controller fails you can keep on working.

To add a mirror on your disk you can take the following steps:

pvcreate ( -B on at least one disk)
vgextend /disken
lvextend -m 1 logical volume /disk ( let op dat boot root en swap op de disk staan die bootable is)
lvlnboot -b ...
lvlnboot -d ...
lvlnboot -s ...
lvlnboot -r ...

for the syntaxes check the man pages.

hope this will help.