[Return to Library] [Contents] [Previous Chapter] [Next Section] [Next Chapter] [Index] [Help]


6    Disk and Disk Group Operations

This chapter presents LSM commands used for managing disks and disk groups. For details on any of the commands mentioned in this chapter, refer to the appropriate reference pages.

The functions described in this chapter can also be performed using the LSM Support Operations menu interface or the graphical user interface dxlsm.


[Return to Library] [Contents] [Previous Chapter] [Next Section] [Next Chapter] [Index] [Help]


6.1    Commands Summary

Table 6-1 introduces the commands and utilities discussed in this chapter.

Table 6-1: Disk and Disk Group Commands

Command Description
voldisk Defines special disk devices, initializes information stored on disks that LSM uses to identify and manage disks, and performs additional special operations.
voldiskadd Adds standard disks to LSM. This utility leads you through the process of initializing a new disk by displaying information and asking questions.
voldg Creates new disk groups, adds and removes disks from disk groups, and enables (imports) or disables (deports) access to disk groups.
voledit Creates, removes, and modifies LSM records.
volevac Moves subdisks off the specified disk medianame to the specified destination disks new_medianame. If new_medianame operands are not specified, then any nonvolatile, nonreserved disks can be used as destination disks. Subdisks that are part of unmirrored striped plexes will be moved by moving the entire plex to a new location.
volmake Creates subdisk, plex, and volume records.
volprint Displays complete or partial information from records in LSM disk group configurations.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.2    Working with Disks

LSM provides commands for adding and removing disks from LSM control, displaying information about the disks, renaming disks, and reserving disks so that the volassist utility does not allocate space from them.

Note that commands default to using the rootdg disk group. See Section 6.3 for information about disk groups.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.2.1    Adding a Disk

To add a disk to LSM, use the following command syntax:

voldiskadd [ devname ]

If you omit the device name from the command line, voldiskadd prompts you for an entry.

The following example shows the steps involved in adding the device rz3 to LSM control, using the default initialize operation, disk group, and disk name.

See also Section 3.3 for other considerations when initializing and adding disks for LSM.

  1. Enter the following command:

    voldiskadd rz3

  2. If the disk has never been used with LSM, the voldiskadd script gives you the option of encapsulating the disk partition instead of initializing it:

      Disk device rz3 appears to have never been used with LSM.
      If rz3 contains valid data then you should encapsulate the
      disk partition instead of initializing it as a new LSM disk.
    
     
    Do you wish to encapsulate rz3? [y,n,q,?] (default: n)

    To preserve the data on the disk, answer y.

    To initialize the disk as a new LSM disk, answer n.

    The remaining steps in this example assume a response of n to this prompt (the disk is being initialized, not encapsulated).

  3. LSM prompts you for a disk group name:


     
    You can choose to add this disk to an existing disk group, to create a new disk group, or you can choose to leave the disk available for future use by future add or replacement operations. To create a new disk group, select a disk group name that does not yet exist. To leave the disk available for future use, specify a disk group name of "none".
     
    Which disk group [<group>,list,q,?] (default: rootdg)

    Press Return to assign the disk to the default disk group rootdg.

    Otherwise, enter the name of the disk group to which you want the disk assigned or enter none to assign the disk as a spare.

  4. LSM now prompts you for a disk name (unless you entered none for a disk group, because spare disks do not get named):


     
    You must now select a disk name for the disk. This disk name can be specified to disk removal, move, or replacement operations. If you move the disk, such as between host bus adapters, the disk will retain the same disk name, even though it will be accessed using a different disk device address name.
     
    Enter disk name [<name>,q,?] (default: disk01)

    Press Return to assign the default disk name disk01, or enter a name of your choice.

  5. LSM presents the following confirmation prompt:


     
    The requested operation is to initialize disk device rz3 and to add this device to disk group rootdg as disk disk01.
     
    Continue with operation? [y,n,q,?] (default: y)

    Press Return to continue with the operation.

  6. If the initialization is successful, LSM displays the following message:


     
    Disk initialization for rz3 completed successfully.
     
    Goodbye.

    If the disk cannot be initialized because the specified partition or an overlapping partition on the disk is open (that is, a partition is actively in use by UFS, AdvFS, LSM or swap), voldiskadd exits with this error message:


     
    Initialization of disk device rz3 failed. Error: rz3 or an overlapping partition is open. Quitting ....

    If the fstype in the disk label of the specified partition or an overlapping partition is set, LSM displays the following warning message to inform you that initializing the disk might destroy existing data:


     
    rz3 is marked in use for 4.2BSD in the disklabel. If you continue with the operation you can possibly destroy existing data.
     
    Would you like to continue?? [y,n,q,?] (default: n)

    If you are sure that the disk partition has no valid data and that the partition can be added to LSM, you can ignore the warning message and answer y to the prompt. The voldiskadd utility then proceeds to initialize the disk partition and add it to LSM.

When you add new disks to existing LSM disk groups, the size of the private region on the new disks is the same size as on the other disks in the disk group. As you add more disks to a disk group, the voldiskadd utility reduces the number of configuration copies and log copies that are initialized for the new disks.

When you add disks to the rootdg disk group, the voldiskadd utility automatically adds the disks to the /etc/vol/volboot file.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.2.2    Displaying Disk Information

Before you use a disk, you need to know if it has been initialized. You need to know if the disk is part of a disk group, since you cannot create volumes on a disk that is not part of a disk group. The voldisk list command displays device names for all recognized disks, the disk names, the disk group names associated with each disk, and the status of each disk.

To display information on all disks that are defined to LSM, use the following command:

voldisk list

LSM returns the following display:

DEVICE    TYPE      DISK         GROUP        STATUS
rz8       sliced    rz8          rootdg       online
rz9d      simple    -            -            online

To display details on a particular disk defined to LSM (for example, rz8) enter:

voldisk list rz8


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.2.3    Renaming a Disk

It is not necessary to give your disks special names; LSM gives the disk a default name when you add it to LSM control. The disk name is used by LSM to identify the disk's location or type.

If you want to change the disk name to reflect a change of ownership or use, enter the old and new disk names with the following voledit command syntax:

voledit rename old_diskname new_diskname

For example, to rename disk03 to disk01 follow these steps:

  1. List the current disk names using voldisk list:

    voldisk list

    DEVICE       TYPE      DISK         GROUP        STATUS
    rz8          sliced    rz8          rootdg       online
    rz9          sliced    disk03       rootdg       online
    rz9d         simple    -            -            online
    

  2. Rename the disk:

    voledit rename disk03 disk01

  3. Confirm that the name change was successful:

    voldisk list

    DEVICE       TYPE      DISK         GROUP        STATUS
    rz8          sliced    rz8          rootdg       online
    rz9          sliced    disk01       rootdg       online
    rz9d         simple    -            -            online
    


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.2.4    Reserving Disks

By default, volassist operations allocate space from any disk that has free space. You may want to reserve some set of disks for special purposes, such as to avoid general use of a particularly slow or a particularly fast disk.

To reserve a disk for special purposes, enter the voledit command using the following syntax:

voledit set reserve=yes diskname

After you enter this command, volassist does not allocate space from the selected disk unless that disk is specifically mentioned on the volassist command line. For example, if disk disk03 is reserved, use the volassist command as shown in the following command to create a 20 megabyte volume on disk03:

volassist make vol03 20m disk03

However, the following command will not use disk03 because the specific disk name is not included on the command line:

volassist make vol04

Note that disk03 is not used even if there is no free space on any other disk.

To turn off reservation of a disk, enter:

voledit set reserve=no  diskname


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.2.5    Removing a Disk

You can remove a disk to move it to another system or because the disk is failing or has failed. However, before removing a disk from the current system, you must move the subdisks to a different physical disk (see volevac(8)). If there is not enough free space to move the subdisks, take the following actions:

Removing a disk involves the following steps:

  1. Remove the disk from its disk group, using the following voldg command syntax:

    voldg [-g groupname ] rmdisk diskname

    The groupname is the name of the disk group to which the disk belongs. The command uses the rootdg disk group by default. The diskname is the name of the disk to be removed.

    For example, to remove disk01 from rootdg, enter:

    voldg rmdisk disk01

  2. After removing a disk from its disk group, remove it from LSM using the following command syntax:

    voldisk rm devname

    The devname is the name of the physical device that you are removing from LSM.

    For example, to remove rz9d from LSM control, enter the command as follows:

    voldisk rm rz9d


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.2.6    Disabling a Disk

You must disable a disk before moving the physical disk device to another system. Also, if a disk becomes corrupted, you need to disable it and remove it.

To disable a disk, first remove the disk from its disk group. Then place the disk in an offline state using the following voldisk command syntax:

voldisk offline devname

For example, to disable the device rz8 (which has the disk name, disk01), enter:

voldg rmdisk disk01
voldisk offline rz8

Note

The device name is used with voldisk because the disk has no disk name after removal from the disk group.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.3    Working with Disk Groups

A disk group is a collection of LSM disks that share a configuration database. Disk groups provide a method for partitioning the configuration database so that its size is manageable and so that database modifications affect identifiable sets of drives. Disk groups also allow LSM to operate with groups of physical disk media that can be moved between systems.

Disk groups are useful in situations where all data related to a particular set of applications or to a particular group of users needs to be made accessible on another system. For example:

LSM supports a default disk group, rootdg, in which all volumes are created if no further specification is given. All commands default to rootdg.

You can create additional disk groups as needed for specialized disk management tasks.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.3.1    Specifying Disk Groups

Most LSM commands allow you to specify a disk group using the -g option. For example, to create a volume named mktvol in a disk group named mktdg, you would use the following command:

volassist -g mktdg make mktvol 50m

The volume device for this volume is /dev/vol/mktdg/mktvol.

In many cases, the disk group does not have to be specified. Most LSM commands use object names specified on the command line to determine the disk group for the operation. For example, a volume can be created on disk mktdg01 without specifying the disk group name:

volassist make mktvol 50m mktdg01

This works for many commands as long as two disk groups do not have objects with the same name. For example, LSM allows you to create volumes named mktvol in both rootdg and in mktdg. If you do this, you must add -g mktdg to any command where you want to manipulate the volume in the mktdg disk group.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.3.2    Displaying Disk Group Information

To use disk groups, you need to know the names of the groups and what disks belong to each group.

To display information on existing disk groups, enter the following command:

voldg list

LSM returns the following message:

NAME         STATE    ID
rootdg       enabled  730344554.1025.harley
newdg        enabled  731118794.1213.harley


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.3.3    Displaying Free Space in a Disk Group

Before you add volumes and file systems to your system, you may want to make sure you have enough free disk space to adequately meet your needs.

To display free space for a disk group, specify a disk group name with the voldg free command using the following syntax:

voldg -g  disk_group free

If you do not specify a disk group, voldg free displays the free space in the default disk group, rootdg:

voldg free

GROUP    DISK     DEVICE   TAG    OFFSET  LENGTH   FLAGS
rootdg   rz8      rz8      rz8    726400  102672   -
rootdg   disk01   rz9      rz9    0       102128   -

The LENGTH column gives the amount of free space, measured in terms of the number of 512-byte sectors.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.3.4    Initializing a New Disk Group

To create a new disk group, use the voldiskadd command, which you also use to add a disk to LSM.

For example, to create the disk group newdg, do the following:

  1. Enter the following command:

    voldiskadd rz9d

    Because rz9d has already been initialized, LSM asks if you want to reinitialize it.

    Add or initialize a disk
    Menu: Logical Storage Manager/Disk/AddDisk
    
     
    Use this operation to add a disk to a disk group. You can select an existing disk group or create a new disk group. You can also initialize a disk without adding it to a disk group, which leaves the disk available for use as a replacement disk. This operation takes, as input, a disk device, for example rz3, a disk group (or none to leave the disk available for as a replacement disk). If you are adding the disk to a disk group, you will be asked to give a name to the disk.
     
    Disk device rz9d appears to have been initialized already. The disk is currently available as a replacement disk.
     
    Do you wish to reinitialize rz9d? [y,n,q,?] (default: y)

    Enter n to add the disk to a disk group without reinitializing it.

  2. LSM prompts you for a disk group:

      You can choose to add this disk to an existing disk
      group, to create a new disk group, or you can choose
      to leave the disk available for use by future add or
      replacement operations.  To create a new disk group,
      select a disk group name that does not yet exist.
      To leave the disk available for future use, specify
      a disk group name of "none".
    
     
    Which disk group [<group>,none,list,q,?] (default: rootdg) newdg

    Enter the new disk group name and press Return.

  3. LSM displays the following message and prompt:


     
    There is no active disk group named newdg.
     
    Create a new group named newdg? [y,n,q,?] (default: y)

    Press Return to continue.

  4. LSM asks for a disk name:

      You must now select a disk name for the disk.  This disk
      name can be specified to disk removal, move, or
      replacement operations.  If you move the disk, such as
      between host bus adapters, the disk will retain the same
      disk name, even though it will be accessed using a
      different disk device address name.
    
     
    Enter disk name [<name>,q,?] (default: disk02)

    Enter the disk name of your choice or press Return to select the default name.

  5. LSM displays a confirmation window:

      The requested operation is to create a new disk group
      named newdg containing disk device rz9d.  The disk
      will be named newdg01 within the disk group.
    
     
    Continue with operation? [y,n,q,?] (default: y)

    Press Return to continue.

  6. Once the operation is complete, LSM returns the following display:

      Disk initialization for rz9d completed successfully.
    
     
    Goodbye.

  7. Enter the following command to see if the disk group was created:

    voldisk list

    LSM displays the following output, which shows that disk02 is a part of the disk group:

    DEVICE       TYPE      DISK         GROUP        STATUS
    rz8          sliced    rz8          rootdg       online
    rz9          sliced    disk01       rootdg       online
    rz9d         simple    disk02       newdg        online
    

When creating a new disk group, the voldiskadd utility prompts you to estimate the number of disks that will be used in the disk group. Based on the number you provide, the utility assigns default values for the private region size, nconfig, and nlog. The values assigned are similar to the values shown in Figure 3-1.

See also Section 3.3.2.2 for other considerations when initializing and adding disks for LSM.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.3.5    Removing a Disk Group

To remove a disk group, close or unmount any volumes in the disk group and then run the following command:

voldg deport  diskgroupname

Deporting a disk group does not actually remove the disk group; instead, it disables use of the disk group by the system. However, disks that are in a deported disk group can be reused, reinitialized, or added to other disk groups.

If you want to move a disk between disk groups, remove the disk from one disk group and add it to the other. For example, to move the physical disk rz3g (attached with the disk name disk04 ) from disk group rootdg and add it to disk group mktdg, you would use the following commands:

voldg rmdisk disk04
voldg -g mktdg adddisk mktdg02=rz3g

This can also be done using voldiskadm by selecting item 3, Remove a disk, from the main menu, and then selecting item 1, Add or initialize a disk.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.3.6    Moving Disks and Volumes between Disk Groups

You can move a set of LSM disks and the volumes configured on those disks into a new disk group, keeping the data in the LSM volumes intact. In the example shown here, the devices rz17, rz19c, rz34, and rz36 are configured into the rootdg disk group as LSM disks disk1, disk2, disk21, and disk22 and contain LSM volumes named Volume1 and Volume2. The following steps show how to move these LSM disks and volumes from the rootdg disk group to a new disk group called staffdg, while preserving the data in Volume1 and Volume2:

  1. Back up the Volume1 and Volume2 data and LSM configuration information as shown here:

    tar cvf ... 
    volprint -ht > vp.info 
    voldisk list >> vp.info 

  2. The rootdg disk group must exist. If disk1, disk2, disk21, and disk22 are currently the only disks in rootdg, you need to add additional disks before you move them, so that rootdg will not be empty. Add at least two disks to rootdg. Note that for ASE configurations, the disks in rootdg must be on a local (that is, not shared) I/O bus. Use the mount, disklabel, and swapon-s commands to find free partitions or disks on the local bus.

    If a disk is unused, add the whole disk, for example rz4, to LSM. Otherwise, you can add a partition, for example rz4h. Use the voldiskadd command to add the disks to LSM as shown here:

    voldiskadd rz4 
    voldiskadd rz6g 

  3. Remove references to disk1, disk2, disk21, and disk22 from the /etc/vol/volboot file. To do this, first use the voldisk list command to get the DISK to DEVICE mapping, and the voldctl list command to see if any of those disks are present. Then use the voldctl rm disk command to remove the disks that are in the /etc/vol/volboot file, but are not in rootdg, as shown here:

    voldisk list 
    voldctl list 
    voldctl rm disk rz17 rz19c rz34 rz36 

  4. Save the Volume1 and Volume2 configurations into a description file:

    volprint -mvpsh Volume1 > v1.df 
    volprint -mvpsh Volume2 > v2.df 

  5. Unmount the volumes, if mounted:

    mount 
    umount /dev/vol/rootdg/Volume1

  6. Remove Volume1 and Volume2 from rootdg:

    voledit -rf rm Volume1 Volume2 

  7. Save the names of the LSM disk name mappings, then remove the disks from rootdg:

    voldisk list > list.out 
    voldg rmdisk disk1 disk2 disk21 disk22 

  8. Create the new disk group (for example, staffdg) and add the disks. Use the output in the columns labeled DISK and DEVICE from the voldisk list command shown previously. For example, if disk1, disk2, disk21, and disk22 were on rz17, rz19c, rz34, and rz36, respectively, use these commands:

    voldg init staffdg disk1=rz17 
    voldg -g staffdg adddisk disk2=rz19c disk21=rz34 \
    disk22=rz36

  9. Restore the LSM configurations for Volume1 and Volume2 into the new disk group; note that v1.df and v2.df are the description files that were saved earlier in this example.

    volmake -g staffdg -d v1.df 
    volmake -g staffdg -d v2.df 

  10. Start the volumes:

    volume -g staffdg start Volume1 Volume2 

  11. Volume1 and Volume2 now have different device paths, as shown here.

    Old path:
    /dev/vol/rootdg/Volume1
    /dev/rvol/rootdg/Volume2

    New path:
    /dev/vol/staffdg/Volume1
    /dev/rvol/staffdg/Volume2

    Update the /etc/fstab file for UFS file systems and the /etc/fdmns file for AdvFS file systems, to use the new paths. For AdvFS, the commands to do this are as follows:

    cd /etc/fdmns/ domain_name
    ls -l | grep Volume1 Volume2 
    rm -f Volume1 Volume2 
    ln -s /dev/vol/staffdg/Volume1 Volume1 
    ln -s /dev/vol/staffdg/Volume2 Volume2 

    The data in Volume1 and Volume2 is now accessible as part of the new staffdg disk group.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.3.7    Moving Disk Groups Between Systems (Deporting and Importing)

Disk groups can be moved between systems. If all disks in a disk group are moved from one system to another, then the disk group can be used by the second system without having to respecify the configuration.

The following steps describe how to move a disk group between systems.

  1. On the first system, close and unmount all volumes in the disk group, then disable local access to the disk group with the following commands:

    voldg deport  diskgroupname
    voldisk rm  ...

  2. Move all the disks to the second system.

  3. Make the disks accessible with the command:

    voldisk define   diskname ...

  4. Enable local access to the disk group on the second system with the following command:

    voldg import  diskgroupname

  5. Start all volumes in the disk group with the following command:

    volrecover -g  diskgroupname -sb 

You may want to move disks from a system that has crashed. In this case, you will not be able to deport the disk group from the first system.

When a disk group is created or imported on a system, that system writes a lock on all disks in the disk group. If you move disks from a system that has crashed or failed to detect the group before the disk is moved, the locks stored on the disks will remain and must be cleared. The system returns the following error message:

voldg:disk group groupname: import failed: Disk in use by another host

To clear locks on a specific set of devices, use the following command:

voldisk clearimport  diskdevicename ...

Be careful when using this command in the ASE environment.

In some cases, you may want to import a disk group when some disks are not available. The import operation normally fails if some disks for the disk group cannot be found among the disk drives attached to the system. If the import operation fails, one of the following error messages is displayed:

voldg: Disk group groupname: import failed: Disk for disk group not found

voldg:Disk group groupname: import failed: Disk group has no valid configuration copies

If some of the disks in the disk group have failed, you can force the disk group to be imported with the following command:

voldg -f import  diskgroupname


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


6.3.8    Displaying Free Space in a Configuration Database

You can also use the voldg list command to display information about the configuration database.

The configuration database size and the log size of a disk group corresponds to the smallest configuration database size and log size of any disk in the disk group.

To display the amount of free space, enter the following command:

voldg list rootdg

Group:     rootdg
dgid:      783105689.1025.lsm
import-id: 0.1
flags:
config:    seqno=0.1112 permlen=173 free=166 templen=6 loglen=26
config disk rz13 copy 1 len=173 state=clean online
config disk rz13 copy 2 len=173 state=clean online
config disk rz11g copy 1 len=347 state=clean online
config disk rz10g copy 1 len=347 state=clean online
log disk rz11g copy 1 len=52
log disk rz13 copy 1 len=26
log disk rz13 copy 2 len=26
log disk rz10g copy 1 len=52

In this display, the "free=166" record indicates that there is enough space in the rootdg disk group to create 166 additional LSM configuration records.

In addition, disk rz13 has a configuration database size of 173 sectors, and disks rz11g and rz10g each have a configuration database size of 347 sectors. The configuration database size of the rootdg disk group is 173 sectors, which corresponds to the smallest configuration database.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Chapter] [Index] [Help]


6.3.9    Increasing Free Space in a Configuration Database

When the disk group runs out of space in the configuration database, LSM displays the following message when creating an LSM record.

volmake plex pl1000

volmake: No more space in disk group configuration

When you run out of space, you can use the voldisk command to increase the size of the configuration database on each disk that is smaller than the current disk group configuration. In the display, note that disk rz13 has a configuration database size of 173 sectors for each copy of the database. By reducing the number of configuration copies on rz13 from 2 to 1, you can increase the size of its configuration database. For example:

voldisk moddb rz13 nconfig=1 nlog=1

When reducing the number of configuration copies, use caution to make sure that there are sufficient copies of the database available for redundancy.

Note

Digital recommends that you create a backup copy of the configuration database before changing the free space.

Refer to Appendix C for information about creating a backup configuration copy using the volsave utility .