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

  1. Create a new root volume group

    1. Initialize the disk to be used in the volume group so it can be booted:

      pvcreate -B /dev/rdsk/c0t0d0
      
    2. Place the LIF information on the disk using the mkboot command.

      mkboot /dev/rdsk/c0t0d0

    3. Create the volume group

      vgcreate vgroot /dev/dsk/c0t0d0

    4. 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

    5. 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

    6. 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

    7. 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

    8. Create a logical volume for /opt

      lvcreate -n opt -L 250 vgroot

    9. Create a logical volume for /usr

      lvcreate -n usr -L 500 vgroot # Choose an appropriate size for your system.

    10. Create a logical volume for /var

      lvcreate -n var -L 500 vgroot # Choose an appropriate size for your system.

    11. Update the autoboot information:

      mkboot -a “hpux (0;)/stand/vmunix” /dev/rdsk/c0t0d0

  2. Update the boot information:

    1. Root information: lvlnboot -r /dev/vgroot/root
    2. Boot information: lvlnboot -b /dev/vgroot/boot
    3. Swap information: lvlnboot -s /dev/vgroot/swap
    4. Dump information: lvlnboot -d /dev/vgroot/dump
  3. 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.
    
  4. 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 necessary

  5. Remove, if appropriate, the lv boot information from the previous volume group: lvrmboot -r /dev/vg00