HP: Moving the root volume group¶
- Title:
HP: Moving the root volume group
- Author:
Douglas O’Leary <dkoleary@olearycomputers.com>
- Description:
HP: Moving the root volume group
- Date created:
06/2001
- Date updated:
06/2001
- Disclaimer:
Standard: Use the information that follows at your own risk. If you screw up a system, don’t blame it on me…
Not sure why you’d want to do something like this - maybe you’re trying to reverse what some idiot did; however, the steps below will move the root volume group
Create a new root volume group
Initialize the disk to be used in the volume group so it can be booted:
pvcreate -B /dev/rdsk/c0t0d0
Place the LIF information on the disk using the mkboot command.
mkboot /dev/rdsk/c0t0d0
Create the volume group
vgcreate vgroot /dev/dsk/c0t0d0
Create a logical volume that is suitable for use as the boot volume. This logical volume has to be the first in the volume group and should be a contiguous volume with bad block relocation turned off.
lvcreate -n stand -C y -r n -L 24 vgroot
Create a logical volume that is suitable for use as the root volume. This logical volume should be a contiguous volume with bad block relocation turned off
lvcreate -n root -C y -r n -L 64 vgroot
Create a logical volume that will be used as primary swap. This volume should be contiguous
lvcreate -n swap -C y -r n -L 64 vgroot
Create a logical volume that will be used as the dump volume. This volume should be contiguous
lvcreate -n dump -C y -r n -L 64 vgroot
Create a logical volume for /opt
lvcreate -n opt -L 250 vgroot
Create a logical volume for /usr
lvcreate -n usr -L 500 vgroot # Choose an appropriate size for your system.
Create a logical volume for /var
lvcreate -n var -L 500 vgroot # Choose an appropriate size for your system.
Update the autoboot information:
mkboot -a “hpux (0;)/stand/vmunix” /dev/rdsk/c0t0d0
Update the boot information:
Root information:
lvlnboot -r /dev/vgroot/root
Boot information:
lvlnboot -b /dev/vgroot/boot
Swap information:
lvlnboot -s /dev/vgroot/swap
Dump information:
lvlnboot -d /dev/vgroot/dump
Copy the data from the old logical volumes to the new ones:
for fs in root opt usr var do mkdir /mnt/${fs} mount /dev/vgroot/${fs} /mnt/${fs} done # tar, cpio, cp -R, whatever suits your fancy to get the information # over to the new logical volumes. Don't forget the devices.
Update the primary boot path a. Identify the hardware path for the disk used in the new root volume group b.
shutdown -r now
c. Interrupt the boot sequence and interact with the ISL d. Via the resulting menu, update the primary boot path. e. Allow the system to come up and troubleshoot as necessaryRemove, if appropriate, the lv boot information from the previous volume group:
lvrmboot -r /dev/vg00