Appendix A. XVM and XLV Logical Volumes

This chapter includes sections on the following topics:

XVM and XLV Logical Volume Creation Comparison

Table A-1 summarizes the creation of a simple XVM logical volume and a simple XLV logical volume. This example is the same example provided in “Creating a Logical Volume with a Three-Way Stripe” in Chapter 7. Refer to that section for a step-by-step explanation of the XVM logical volume creation.

The commands provided in this example create a logical volume named stripedvol in which the data is to be striped across three disks. Both of these examples assume that the disks have already been partitioned as IRIX option disks. Although the commands are presented side-by-side in the table, they do not necessarily correspond to the same action.

Table A-1. XVM and XLV Logical Volume Creation

XVM Logical Volume

XLV Logical Volume

Label the disks as XVM physical volumes:

xvm:cluster> label -name disk0 \
dks2d70vol

xvm:cluster> label -name disk1 \
dks2d71vol

xvm:cluster> label -name disk2 \
dks2d72vol

Create the logical volume:

xlv_make> vol stripedvol

 

Create the data subvolume:

xlv_make> data

Create XVM slices out of each disk:

xvm:cluster> slice -all disk*

Create the plex:

xlv_make> plex

Create the striped volume element and attach it to the volume stripedvol (creating the data subvolume in the process):

xvm: cluster> stripe -volname \
stripedvol slice/disk0s0 \
slice/disk1s0 slice/disk2s0

Create the striped volume element to be striped across the three disks:

xlv_make> ve -stripe dks0d2s7 \ dks0d3s7 dks5d4s7

Exit the XVM Volume Manager:

xvm:cluster> quit

Exit the XLV Volume Manager. Since the xlv_make -A option was not used, xlv_assemble is automatically called to configure the volume into the running kernel:

xlv_make> end

xlv_make> exit

Execute the mkfs command on the filesystem:

# mkfs /dev/cxvm/stripedvol

Execute the mkfs command on the filesystem:

# mkfs /dev/xlv/stripedvol

Mount the filesystem. For a shared filesystem in a CXFS cluster, you mount the filesystem with the CXFS GUI or the cmgr(1M) command. For a local filesystem, you can use the mount command.

Mount the filesystem:

# mount /dev/xlv/stripedvol /mnt


Upgrading from XLV to XVM Logical Volumes

Use the following procedure to convert an XLV logical volume configuration to an XVM logical volume configuration:

  1. Save the old XLV configuration and disk partitions:

    # xlv_mgr -c "script -write xlvconfig all"
    # prtvtoc /dev/rdsk/*vh > diskparts
    

  2. Back up existing filesystems.

  3. Delete the XLV volumes you are converting.

    To delete all volumes, unmount all XLV filesystems then execute the following commands:

    # xlv_shutdown
    # xlv_mgr -x -c “delete all_labels”
    

    Do not delete all XLV volumes if you have an XLV root volume, because you cannot use an XVM volume as a root volume.

  4. Give the XLV disks to XVM to manage by labeling them as XVM disks:

    # xvm label -name xvmdisk1 dks0d1vh
    

  5. Create slices to match the old partitions used by XLV.

    For the XVM -start argument, subtract the size of the volume header from the prtvtoc partition start block. In this case, if slice 7 starts at block 4096 and is adjacent to the volume header, use -start 0.

    The -length argument is the prvtoc partition size.

    # xvm slice -start 0 -length 17779016 xvmdisk1
    

  6. Create concatenated or striped volumes on top of the slices. Name the volumes to match previous XLV volume names to minimize the need to change the contents of /etc/fstab.

  7. Mount the filesystems and run xfs_check on the filesystems. If there is a problem mounting the filesystems or if there is a problem that xfs_check reveals, check the following:

    • Compare the slices created on each disk with the saved prtvtoc information.

    • Compare the organization of the stripes and concatenated volumes with the XLV information.

If you find you need to restore your XLV configuration, you can use the following procedure as long as you have not built a new configuration using the XVM Volume Manager that you cannot replicate in XLV (for example, you cannot stripe concatenated volume elements in XLV).

  1. Unmount the filesystems:

    # umount -a
    

  2. Remove the XVM volume header from all the physical volumes and restore the original partitions:

    # xvm unlabel -force phys/*
    

  3. Rebuild the XLV configuration:

    # xlv_make xlvconfig
    

Converting XLV Mirrored Stripes to XVM Striped Mirrors

The way that mirrors are configured in XLV logical volumes increases the likelihood that two disk failures will cause the entire mirror to fail. This is because an XLV logical volume could include a mirrored stripe, but not a striped mirror. The XVM Volume Manager, on the other hand, does allow you to stripe mirrors.

The following procedure provides a safe way to convert from XLV mirrored stripes to XVM striped mirrors. In this procedure, the logical volume is named alpha and the disk names are dks18* and dks5*.

  1. Unmount the filesystem you are converting.

  2. Create a script to regenerate the XLV configuration for alpha in case you want to recreate it later:

    # xlv_mgr -c "script -write alpha object alpha"
    

  3. Detach plex 0 from the XLV volume:

    # xlv_mgr -c "detach plex alpha.data.0 alphaplex"
    

  4. Delete the object. If other XLV volumes exist on this disk, generate a script to regenerate the volumes as they will also need to be converted:

    # xlv_mgr -c "delete object alphaplex"
    

  5. Call up the XVM Volume Manager and label the plex0 disks:

    xvm:local> label dks18*
    

  6. In this example, the filesystem has a single slice per disk. Create an XVM slice on each of the disks, consisting of the entire disk:

    xvm:local> slice -all dks18*
    

  7. Create a stripe to match the XLV configuration:

    xvm:local> stripe -volname alpha slice/dks18*
    

  8. Leave the XVM Volume Manager and verify that the filesystem mounts correctly:

    # mount /dev/lxvm/alpha /mountpoint
    

  9. The data is now available through the XVM Volume Manager, but is not mirrored. Note the topology of the volume alpha:

    xvm:local> show -t alpha
    vol/alpha                             0 online
        subvol/alpha/data             106664448 online,open
            stripe/stripe0            106664448 online,tempname,open
                slice/dks18d1s0            17777424 online,open
                slice/dks18d2s0            17777424 online,open
                slice/dks18d3s0            17777424 online,open
                slice/dks18d4s0            17777424 online,open
                slice/dks18d5s0            17777424 online,open
                slice/dks18d6s0            17777424 online,open
    

    Insert mirrors above each of the slices in the volume alpha:

    xvm:local> insert mirror slice/dks18*
    

    This yields the following configuration:

    xvm:local> show -t alpha
    vol/alpha                             0 online
        subvol/alpha/data             106664448 online,open
            stripe/stripe0            106664448 online,tempname,open
                mirror/mirror0             17777424 online,tempname
                    slice/dks18d1s0            17777424 online,open
                mirror/mirror1             17777424 online,tempname
                    slice/dks18d2s0            17777424 online,open
                mirror/mirror2             17777424 online,tempname
                    slice/dks18d3s0            17777424 online,open
                mirror/mirror3             17777424 online,tempname
                    slice/dks18d4s0            17777424 online,open
                mirror/mirror4             17777424 online,tempname
                    slice/dks18d5s0            17777424 online,open
                mirror/mirror5             17777424 online,tempname
                    slice/dks18d6s0            17777424 online,open
    

  10. Convert the other half of the XLV plex to an XVM volume and attach to the mirrors:

    # xlv_mgr -c "delete object alpha"
    xvm:local> label dks5* 
    xvm:local> slice -all dks5*
    xvm:local> attach slice/dks5d1s0 mirror0
    xvm:local> attach slice/dks5d2s0 mirror1
    xvm:local> attach slice/dks5d3s0 mirror2
    xvm:local> attach slice/dks5d4s0 mirror3
    xvm:local> attach slice/dks5d5s0 mirror4
    xvm:local> attach slice/dks5d6s0 mirror5
    

    Alternately, you could use the following syntax for the attach commands:

    xvm:local> attach slice/dks5d1s0 stripe0/0
    xvm:local> attach slice/dks5d2s0 stripe0/1
    xvm:local> attach slice/dks5d3s0 stripe0/2
    xvm:local> attach slice/dks5d4s0 stripe0/3
    xvm:local> attach slice/dks5d5s0 stripe0/4
    xvm:local> attach slice/dks5d6s0 stripe0/5
    

    Show the topology of volume alpha:

    xvm:local> show -t alpha
    vol/alpha                0 online
      subvol/alpha/data  106664448 online,open
        stripe/stripe0  106664448 online,tempname,open
           mirror/mirror0  17777424 online,tempname,reviving:28%,open
               slice/dks18d1s0  17777424 online,open
               slice/dks5d1s0   17777424 online,open
           mirror/mirror1  17777424 online,tempname,reviving:queued,open
               slice/dks18d2s0  17777424 online,open
               slice/dks5d2s0   17777424 online,open
           mirror/mirror2  17777424 online,tempname,reviving:queued,open
               slice/dks18d3s0  17777424 online,open
               slice/dks5d3s0   17777424 online,open
           mirror/mirror3  17777424 online,tempname,reviving:queued,open
               slice/dks18d4s0  17777424 online,open
               slice/dks5d4s0   17777424 online,open
           mirror/mirror4  17777424 online,tempname,reviving:queued,open
               slice/dks18d5s0  17777424 online,open
               slice/dks5d5s0   17777424 online,open
           mirror/mirror5  17777424 online,tempname,reviving:queued,open
               slice/dks18d6s0  17777424 online,open
               slice/dks5d6s0   17777424 online,open
    

  11. Update the /etc/fstab file entry from /dev/xlv/alpha to /dev/lxvm/alpha.