Document Text
Title : How to boot from a split mirror
Date : 971211
Type : EN
Document ID : A4934646
PROBLEM TEXT
Can you go over the procedure on how to boot from mirror
after mirror is split, boot from alt disc?
DETAIL TEXT
Operating System - HP-UX
Version -10.10
Hardware System - HP 9000
Series -K410
RESOLUTION TEXT
It is possible to boot successfully from a split mirrored
drive. However, to protect yourself in the event an install
or patch installation goes bad is to use copyutil or to create
an alternate boot disk.
Neither the split logical volume or the primary logical volume
can be increased or decreased in size while they are split.
Any changes in the sizes of the lvol will result in the
inability to merge and resynchronize.
Particular attention must be paid to the order in which the
logical volumes are split. It is critical that the last logical
volume to be split is the root logical volume. In default,
this would mean that a system running HP-UX 10.10 or older
would use lvol1 to /. In an upgraded 10.20 system, where /stand
is not it's own logical volume this would also apply. In the
situation where 10.20 has been cold installed, lvol1 contains
/stand, and lvol3 contains the rest of the root file system
mounted to /.
This can be verified with the lvlnboot -v command and bdf.
In order to successfully boot from a mirror:
Prior to splitting the logical volumes:
1. Make 2 copies of the fstab file:
cp /etc/fstab /etc/fstab.b4split
cp /etc/fstab /etc/fstab.aftersplit
2. Modify the fstab.aftersplit file to reflect the split logical
volumes:
vi /etc/fstab.aftersplit
/dev/vg00/lvol1b / hfs defaults 0 1
/dev/vg00/lvol3b /home vxfs delaylog 0 2
/dev/vg00/lvol4b /opt vxfs delaylog 0 2
...
/dev/vg00/lvol7b /var vxfs delaylog 0 2
3. Split the logical volumes in DESCENDING order:
lvsplit /dev/vg00/lvol7
lvsplit /dev/vg00/lvol6
lvsplit /dev/vg00/lvol5
lvsplit /dev/vg00/lvol4
lvsplit /dev/vg00/lvol3
lvsplit /dev/vg00/lvol2
lvsplit /dev/vg00/lvol1
After splitting all the logical volumes, make sure you have all
device files for your lvols in the /dev/vg00 directory. For
example, for lvol1 you should have:
lvol1
rlvol1
lvol1b
rlvol1b
4. Run fsck on each lvolb to ensure there has not been any corruption.
fsck /dev/vg00/lvol1b
fsck -F vxfs -o full,nolog /dev/vg00/lvol3b
fsck -F vxfs -o full,nolog /dev/vg00/lvol4b
fsck -F vxfs -o full,nolog /dev/vg00/lvol5b
fsck -F vxfs -o full,nolog /dev/vg00/lvol6b
fsck -F vxfs -o full,nolog /dev/vg00/lvol7b
5. Perform whatever tasks you need to do to the primary logical
volumes such as adding patches, upgrading the operating system.
6. In the event of a problem, perform the following steps to boot
from the mirror drive:
7. Reboot the system and come back up in LVM maintenance mode:
shutdown -r 0
When the message is displayed telling you to press Esc (or any key)
within 10 seconds to stop the selection process, do so. Select s
from the menu, or type search to identify bootable devices.
When it finds the mirror disk, enter the appropriate command to
boot from the mirror drive:
b Px ipl (where x = mirror disk)
Interact with ISL? y
At the ISL> prompt, enter:
hpux -lm boot
8. Once the system is booted to LVM maintenance mode, activate vg00.
vgchange -a y /dev/vg00
9. Mount the split logical volume for usr to /usr. This will give
access to the cp command.
mount /dev/vg00/lvol4b /usr
10. Copy /etc/fstab.aftersplit to /etc/fstab
cp /etc/fstab.aftersplit /etc/fstab
11. Modify lvlnboot to reflect the split logical volumes:
If this is a pre 10.20 OS or an upgraded 10.20, then use:
lvrmboot -r /dev/vg00
lvlnboot -r /dev/vg00/lvol1b
lvlnboot -s /dev/vg00/lvol2b
lvlnboot -d /dev/vg00/lvol2b
If this is a cold installed 10.20 or newer with /stand in lvol1
use:
lvrmboot -r /dev/vg00
lvlnboot -b /dev/vg00/lvol1b
lvlnboot -r /dev/vg00/lvol3b
lvlnboot -s /dev/vg00/lvol2b
lvlnboot -d /dev/vg00/lvol2b
12. Reboot the system, and come up in single user mode on the
mirror drive:
reboot -q
Interrupt the boot sequence and do a search, select the mirror
drive:
b Px ipl (where x = mirror drive)
At the ISL> prompt enter hpux -is boot
13. Mount all logical volumes:
mount -a
14. Ensure all lvols mounted properly.
bdf
The output should display the "b" versions of each lvol
being mounted to the mount points.
15. If / is mounted to /dev/root, remove /etc/mnttab, and execute the
mountall command to recreate /etc/mnttab.
rm /etc/mnttab
mountall
16. Run bdf again. Everything should look correct now, with lvol1b
mounted to /.
17. If desired, move to multi-user mode.
init 4
System should behave normally now, but be booted from the split mirror
disk.
If the modifications were successful, and you now want to merge your
mirrors with both sides reflecting the changes you made:
1. Reboot the system:
shutdown -r 0
2. Interrupt the boot sequence and boot to lvm maintenance mode
on the primary drive. Refer to step 7, and select the primary
drive.
3. After the system has successfully booted, modify the lvm
structure as follows:
For upgraded 10.20, or all previous versions:
lvrmboot -r /dev/vg00
lvlnboot -r /dev/vg00/lvol1
lvlnboot -s /dev/vg00/lvol2
lvlnboot -d /dev/vg00/lvol2
lvlnboot -R
For cold installed 10.20 or newer with /stand on lvol1:
lvrmboot -r /dev/vg00
lvlnboot -b /dev/vg00/lvol1
lvlnboot -r /dev/vg00/lvol3
lvlnboot -s /dev/vg00/lvol2
lvlnboot -d /dev/vg00/lvol2
4. Mount the appropriate lvol to /usr
mount /dev/vg00/lvol6 /usr
5. Copy /etc/fstab.b4split to /etc/fstab
cp /etc/fstab.b4split /etc/fstab
Verify it is correct with more /etc/fstab.
6. Reboot the system and allow it to come back up by itself.
7. Merge the mirrors back together. Be careful to merge them
the right way.
lvmerge /dev/vg00/lvol8b /dev/vg00/lvol8
lvmerge /dev/vg00/lvol7b /dev/vg00/lvol7
...
lvmerge /dev/vg00/lvol1b /dev/vg00/vlol1
If the changes you made to the primary side were unsuccessful,
you can remerge your mirrors from your current configuration.
CAUTION: Review the man page on lvmerge before performing this
step. It should go as follows:
lvmerge /dev/vg00/lvol7 /dev/vg00/lvol7b
lvmerge /dev/vg00/lvol6 /dev/vg00/lvol6b
...
lvmerge /dev/vg00/lvol1 /dev/vg00/lvol1b
After the resync has completed, you will have lvolb device files
left in /dev/vg00. These can be renamed using the mv command.
mv /dev/vg00/lvol1b /dev/vg00/lvol1
mv /dev/vg00/rlvol1b /dev/vg00/rlvol1
You will end up with new minor numbers, but that should not be a
problem.
(c) Copyright 1996-1998 Hewlett-Packard Company.