Operating System - HP-UX
1834366 Members
2128 Online
110066 Solutions
New Discussion

HPUX Configuration with 2 bootable disks without Mirror

 
SOLVED
Go to solution
LEY Serge
Occasional Contributor

HPUX Configuration with 2 bootable disks without Mirror

Hello,

I would have a special configuration :

A server with 2 identical disks.
Only one disk is used in normal circonstances.
The 2 disks are bootable. One time a day I take a snapshot of the first disk and I copy it to the second.

I don't want to use Mirror UX for this. It's not mirroring.

Thera are a lot of advantage to this (ex: testing patches, and going back to the second disk in case of problems...)

Has any one an idea to do this operation ? Is it possible with LVM ?

Thanks
6 REPLIES 6
Chris B
Occasional Advisor

Re: HPUX Configuration with 2 bootable disks without Mirror

Here are some thoughs...
1. Write a script to create boot disk, create all lv's as per your original boot disk, use cpio or some thing like to copy all your data from origional disk, do boot test with it. This script will create image of your root disk without using LVM-Mirror-UX.
2. Create mirrored boot disk, while installing patch or what ever, split a mirror and do every thing on secondary so primary is saved, if you get in to trouble establish mirror and re-sync it.
Chance happens to all but turn it to account is gift of few.
Victor BERRIDGE
Honored Contributor

Re: HPUX Configuration with 2 bootable disks without Mirror

Or use Ignite-ux make-recovrey and like that you have tested your tape...

All the best

Victor
Patrick Wallek
Honored Contributor

Re: HPUX Configuration with 2 bootable disks without Mirror

Take a look at this thread:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xa1c6d06ed8c8d4118fef0090279cd0f9,00.html

Specifically Peggy Fong's response. She goes into very good detail about how to do what you want to do.
Bruce Regittko_1
Esteemed Contributor

Re: HPUX Configuration with 2 bootable disks without Mirror

Hi,

I used to have to install HP-UX weekly on 16 training systems without Ignite and only 1 installation CD. What I did was install the OS (plus the course files) on one machine's first disk and then use dd(1) to copy the first disk to the second. Then I moved the second disk to the next machine and booted off it. Then I got 2 machines running dd and then 4 and then... . All that was left was resetting the host and ip-addresses. The command I used was

dd if=/dev/rdsk/c0t5d0 of=/dev/rdsk/c0t8d0 bs=64k

The point of all of the above verbage is that dd copies each byte of the disk including the LVM structures, boot information, and, of course, the filesystems. Assuming you have identical disks, you will have identical data on the disks after dd.

--Bruce

p.s. Make sure you use the raw disk device files with dd and make absolutely certain you have your if and of files correct.
www.stratech.com/training
Peggy Fong
Respected Contributor
Solution

Re: HPUX Configuration with 2 bootable disks without Mirror

Hi
When you only have two disks then mirroring is not the way to go. You can definitely use LVM to create another boot device. This will be a long posting (I posted it back in December). It is the procedures to create another bootable disk (in a separate volume group).

I've made a backup root device hundreds of times.

Here is the manual way to create a secondary bootable device as a copy of the primary root disk (not a mirror).

Example:
primary disk= /dev/dsk/c0t6d0
seconday disk= /dev/dsk/c4t6d0

mkdir /dev/vgalt00
mknod /dev/vgalt00 group c 64 0x020000
Note: make sure minor node is unique - your choice.

pvcreate -fB /dev/rdsk/c4t6d0
mkboot /dev/rdsk/c4t6d0
mkboot -a "hpux -lq" /dev/rdsk/c4t6d0
lifcp /dev/rdsk/c4t6d0:AUTO -
Note: this is to confirm your AUTO file is ok.

vgcreate /dev/vgalt00 /dev/dsk/c4t6d0

lvcreate -L {sizeofstand} -s y -C y -r n -n bstand /dev/vgbroot

lvcreate -L {sizeofswap} -s y -C y -c n -r n -M n -n bswap /dev/vgalt00

lvcreate -L {sizeofroot} -s y -C y -r n -n broot /dev/vgalt00

lvcreate -L {sizeofusr} -s y -n busr /dev/vgalt00

lvcreate -L {sizeoftmp} -s y -n btmp /dev/vgalt00

Continue in this manner for every lvol on your primary root disk matching the order on the disk, the size and using any naming convention you want (e.g. blvol1, blvol2, etc) I like broot, bswap, etc. Likewise the volume group can be any name (vgbroot, vg02, vgaltboot, etc)

***Next steps are important or you won't boot from the new disk.
lvlnboot -b /dev/vgbroot/bstand
lvlnboot -r /dev/vgbroot/broot
lvlnboot -s /dev/vgbroot/bswap
lvlnboot -d /dev/vgbroot/bswap

lvlnboot -v
check the output should have vg00 and vgbroot as bootable volume groups.

dd all the lvols on the primary disk to the lvols on the second disk. You can also mount and use cpio if you wish (if you use cpio then you need to newfs the file systems (hfs or vxfs as needed).

Example:

dd if=/dev/vg00/rlvol1 of=/dev/vgalt00/rbstand bs=64k (or whatever bs you want to use)

After your dd's or cpio's are complete, then fsck your filesystems.

Need to edit the fstab on the 2d disk so that it will properly mount file systems.

mkdir /mnt
mount /dev/vgalt00/broot /mnt

cd /mnt/etc
cp fstab fstab.vg0
edit /mnt/etc/fstab

change the "vg00" to "vgalt00" for all the file systems you put on the second bootable device. Save the file. Also copy the file to /mnt/etc/fstab.vgalt00

umount /dev/vgaltboot/broot

You should now be able to boot to the second bootable device (either use setboot -p to change you boot path for the 2d disk or interrupt the boot and select the second disk boot path). After that the system should come up and run and include all your other mount points, applications, etc.

This process can be automated and changed, etc.
It has saved us many times and shortened what could have been major outages to a simple reboot. It's a great back out for major patching, can be used to to to new releases - lots of flexibility. Plus you have online copies of files depending on how often you backup. I only do so once a week and before any major change.

HTH
Peggy
Peggy Fong
Respected Contributor

Re: HPUX Configuration with 2 bootable disks without Mirror

oops - pity we cannot correct postings after submitting. Anywhere you see vgbroot change that to vgalt00 (old habit - don't know why I was changing it for this posting. Again, Hope this is what you're looking for.

Regards,
Peg