Solaris Volume Manager Administration Guide

ProcedureHow to Rename a Volume

Steps
  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 22–2 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.

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.