Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
21.  Maintaining Solaris Volume Manager (Tasks) Viewing the Solaris Volume Manager Configuration How to View the Solaris Volume Manager Volume Configuration Example--Viewing the Solaris Volume Manager Volume Configuration  Previous   Contents   Next 
   
 

Renaming Volumes

Background Information for Renaming Volumes

The metarename command with the -x option can exchange the names of volumes that have a parent-child relationship. For more information, see "How to Rename a Volume" and the metarename(1M) man page.

Solaris Volume Manager enables you to rename most types of volumes at any time, subject to some constraints.

Renaming volumes or switching volume names is an administrative convenience for management of volume names. For example, you could arrange all file system mount points in a desired numeric range. You might rename volumes to maintain a naming scheme for your logical volumes or to allow a transactional volume to use the same name as the underlying volume had been using.

Before you rename a volume, make sure that it is not currently in use. For a file system, make sure it is not mounted or being used as swap. Other applications using the raw device, such as a database, should have their own way of stopping access to the data.

Specific considerations for renaming volumes include the following:

  • You can rename any volume except the following:

    • Soft partitions

    • Volumes on which soft partitions are directly built

    • Volumes that are being used as log devices

    • Hot spare pools

  • You can rename volumes within a disk set. However, you cannot rename volumes to move them from one disk set to another.

You can use either the Enhanced Storage tool within the Solaris Management Console or the command line (the metarename(1M) command) to rename volumes.

Exchanging Volume Names

When used with the -x option, the metarename command exchanges the names of an existing layered volume with one of its subdevices. This exchange can occur between a mirror and one of its submirrors, or a transactional volume and its master device.


Note - You must use the command line to exchange volume names. This functionality is currently unavailable in the Solaris Volume Manager GUI. However, you can rename a volume with either the command line or the GUI.


The metarename -x command can make it easier to mirror or unmirror an existing volume, and to create or remove a transactional volume of an existing volume.

  • You cannot rename a volume that is currently in use. This includes volumes that are used as mounted file systems, as swap, or as active storage for applications or databases. Thus, before you use the metarename command, stop all access to the volume being renamed. For example, unmount a mounted file system.

  • You cannot exchange volumes in a failed state, or volumes using a hot spare replacement.

  • An exchange can only take place between volumes with a direct parent-child relationship. You could not, for example, directly exchange a stripe in a mirror that is a master device with the transactional volume.

  • You must use the -f (force) flag when exchanging members of a transactional device.

  • You cannot exchange (or rename) a logging device. The workaround is to either detach the logging device, rename it, then reattach it to the transactional device; or detach the logging device and attach another logging device of the desired name.

  • Only volumes can be exchanged. You cannot exchange slices or hot spares.

How to Rename a Volume

  1. Check the volume name requirements ("Volume Names"), and "Background Information for Renaming Volumes".

  2. Unmount the file system that uses the volume.

  3. To rename the volume, use one of the following methods:

    • From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node and select the volume you want to rename. Right-click the icon and choose the Properties option, then follow the instructions on screen. For more information, see the online help.

    • Use the following format of the metarename command:

      metarename old-volume-name new-volume-name
      • old-volume-name is the name of the existing volume.

      • new-volume-name is the new name for the existing volume.

      See metarename(1M) for more information.

  4. Edit the /etc/vfstab file to refer to the new volume name, if necessary.

  5. Remount the file system.

Example--Renaming a Volume Used for a File System

# umount /home
# metarename d10 d100
d10: has been renamed to d100
(Edit the /etc/vfstab file so that the file system 
references the new volume)
# mount /home

In this example, the volume d10 is renamed to d100. Because d10 contains a mounted file system, the file system must be unmounted before the rename can occur. If the volume is used for a file system with an entry in the /etc/vfstab file, the entry must be changed to reference the new volume name. For example, the following line:

/dev/md/dsk/d10 /dev/md/rdsk/d10 /docs ufs 2 yes -

should be changed to:

/dev/md/dsk/d100 /dev/md/rdsk/d100 /docs ufs 2 yes -

Then, the file system should be remounted.


Note - If you have an existing mirror or transactional volume, you can use the metarename -x command to remove the mirror or transactional volume and keep data on the underlying volume. For a transactional volume, as long as the master device is a volume (RAID 0, RAID 1, or RAID 5 volume), you can keep data on that volume.


Working with Configuration Files

Solaris Volume Manager configuration files contain basic Solaris Volume Manager information, as well as most of the data necessary to reconstruct a configuration. The following sections illustrate how to work with these files.

How to Create Configuration Files

  • Once you have defined all appropriate parameters for the Solaris Volume Manager environment, use the metastat -p command to create the /etc/lvm/md.tab file.

    # metastat -p > /etc/lvm/md.tab

    This file contains all parameters for use by the metainit, and metahs commands, in case you need to set up several similar environments or re-create the configuration after a system failure.

    For more information about the md.tab file, see "Overview of the md.tab File".

 
 
 
  Previous   Contents   Next