How to change the LVM Boot Device Hardware Path for a Virtual Partiton?
Contents
Verification[edit]
These instructions require that the virtual partition be constrained in the following way:
The logical volume used for the primary swap device must be on the boot device; in other words, boot and swap must be on the same disk device.
This can be verified by the following steps:
1. Run lvlnboot.
lvlnboot -v /dev/vg00
2. Examine the output to identify the "Boot" and "Swap" logical volumes. For example:
Boot: lvol1 on: /dev/dsk/c1t6d0 Swap: lvol2 on: /dev/dsk/c1t6d0
3. Make sure that the boot and swap logical volumes are on the same device.
CAUTION: If the boot and swap logical volumes are not on the same device, do not proceed with these instructions. You will need to contact HP for assistance.
Preparation[edit]
Before changing the hardware path of the boot device:
1. Create a mapfile for the root volume group. Keep the mapfile inthe root (/) directory, so that it is accessible during single user mode boot.
vgexport -p -m /mapfile.vg00 /dev/vg00
Get a list of physical volumes (PVs) in the root volume group. Keep the PV list file in the root (/) directory, so that it is accessible during single user mode boot.
vgexport -p -f /pvs.vg00 /dev/vg00
2. You may now shutdown the virtual partition and physically move the disk.
Change the boot device hardware path[edit]
1. From another virtual partition, change the target virtual partition atrributes
# vparmodify -p partition_name -a io:new_path:boot -B manual # vparmodify -p partition_name -d io:old_path
where
- partition_name is the target virtual partition
- new_path is the new hardware path of the disk
- old_path is the old hardware path of the disk
2. Verify the attributes
vparstatus -v -p partition_name
Boot into LVM maintenance mode[edit]
Boot the target virtual partition into LVM maintenance mode. For example, at the monitor prompt:
MON> vparload -o -lm -p partition_name
LVM maintenance mode steps[edit]
1. Once the partition comes up in LVM maintenance mode, run ioscan to get the device filename of the boot device
# ioscan -fnkCdisk
If the device filename (/dev/dsk/file) is new, use insf to install the special files in /dev directory.
2. Run vgscan to get the device filenames grouped withboot device.
# vgscan
3. Remove the old information about root volume group.
# vgexport /dev/vg00
You may have to remove /etc/lvmtab.
4. Prepare to import the root volume group (vg00).
# mkdir /dev/vg00 # mknod /dev/vg00/group c 64 0x00000
5. Import the root volume group (vg00). For example:
# vgimport -m /mapfile.vg00 /dev/vg00 /dev/dsk/c1t1d0 /dev/dsk/c1t1d1
where the device filenames are obtained from the ioscan and vgscan above
6. Activate the root volume group (vg00):
# vgchange -a y /dev/vg00
You may also have to cleanup and prepare LVM logical volume to be root, boot, primary swap, or dump volume as follows:
# lvrmboot -r /dev/vg00
# lvlnboot -b /dev/vg00/lvol1
# lvlnboot -r /dev/vg00/lvol3
# lvlnboot -s /dev/vg00/lvol2
# lvlnboot -d /dev/vg00/lvol2
# mount
7. Verify that the hardware path for the boot device matches the primary boot path.
# lvlnboot -v /dev/vg00
8. If the hardware path has not changed to the primary boot path, change it by running lvlnboot with the recovery (-R) option. This step is normally not necessary.
# lvlnboot -R /dev/vg00
9. Reboot the target virtual partition.