Solstice DiskSuite 4.2.1 User's Guide

Chapter 5 Removing DiskSuite Objects

This chapter describes how to remove DiskSuite objects, both with the DiskSuite Tool graphical interface and with the command line utilities.

Use the following to proceed directly to the section that provides step-by-step instructions for using DiskSuite Tool.

Use the following to proceed directly to the section that provides step-by-step instructions for using the command line interface.

Overview of Removing DiskSuite Objects

This chapter describes the steps to remove DiskSuite objects, including:

You may need to remove objects when performing troubleshooting or reconfiguration, or to simply delete the object from the system. For general information on DiskSuite, see Solstice DiskSuite 4.2.1 Reference Guide.

Prerequisites for Removing DiskSuite Objects

Here are the prerequisites for the steps in this chapter:

Removing State Database Replicas

This section describes how to remove state database replicas from the system.

Preliminary Information for Removing State Database Replicas

How to Remove State Database Replicas (DiskSuite Tool)

  1. Make sure you have met the prerequisites ("Prerequisites for Removing DiskSuite Objects") and have read the preliminary information ("Preliminary Information for Removing State Database Replicas").

  2. Drag the MetaDB object from the Objects list to the Metadevice Editor window's canvas.

  3. Drag the state database replica to be deleted from the MetaDB object.

    Drag the selected slice to the Metadevice Editor's canvas.

  4. Click inside the top rectangle of the MetaDB object and click Commit.

    The status of the slice that contained the state database replica changes to Unassigned in the Slice Browser.

  5. Put the slice away.

    Select the slice that was dragged out of the MetaDB object and click Put Away. The slice is returned to the Slice Browser.

  6. To verify that the MetaDB object was committed, display the Configuration Log.


    Note -

    A Warning message is displayed if you attempt to delete all state database replicas.


How to Remove State Database Replicas (Command Line)

After checking the prerequisites ("Prerequisites for Removing DiskSuite Objects"), and the preliminary information ("Preliminary Information for Removing State Database Replicas"), use the metadb(1M) command with the -d option to delete state database replicas. Make sure that the state database replica is no longer needed. Refer to the metadb(1M) man page for more information.

Example -- Deleting Two State Database Replicas


# metadb -d c0t2d0s0 c0t1d0s0

This example deletes two state database replicas, located on slices /dev/dsk/c0t2d0s0 and /dev/dsk/c0t1d0s0.

Example -- Forcing the Deletion of All State Database Replicas


# metadb -f -d c0t1d0s3 c4t1d0s3

This example deletes a system's remaining two state database replicas. The -f option is needed.

Removing Stripes and Concatenations

This section describes how to remove stripes and concatenations from the system.


Caution - Caution -

Any data that is on a metadevice is lost when it is removed from the system for good, and its underlying slices are reused. Data should be backed up if you need to save it.


Preliminary Information for Removing Stripes and Concatenations

How to Remove a Stripe, Concatenation, or Concatenated Stripe (DiskSuite Tool)

  1. Make sure you have met the prerequisites ("Prerequisites for Removing DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Removing Stripes and Concatenations").

  2. Make sure you have a current backup of the metadevice.

  3. Stop access to the metadevice.

    For example, a file system on the metadevice should be unmounted. For a non-UFS application, such as a database, perform the steps necessary to stop the application's use of the metadevice.

  4. Double-click the stripe or concatenation to be deleted in the Objects list.

    The metadevice object appears on the canvas.

  5. Display the object's pop-up menu and choose Delete.

  6. Click Really Delete on the dialog box that is displayed.

  7. [Optional] If there is an entry in the /etc/vfstab file for this metadevice, delete that entry.

    You do not want to confuse the system by asking it to mount a file system on a non-existent metadevice.

  8. To verify that the object was deleted, display the Configuration Log.


    Note -

    Hot spare pools assigned to the metadevice are not deleted.


How to Remove a Stripe, Concatenation, or Concatenated Stripe (Command Line)

After checking the prerequisites ("Prerequisites for Removing DiskSuite Objects"), and the preliminary information ("Preliminary Information for Removing Stripes and Concatenations"), use the metaclear(1M) command to delete the metadevice. Refer to the metaclear(1M) man page for more information.

Example -- Removing a Concatenation


# umount d8
# metaclear d8
d8: Concat/Stripe is cleared
(Edit the /etc/vfstab file)

This example clears the concatenation d8 that also contains a mounted file system. The file system must be unmounted before the metadevice can be cleared. The system displays a confirmation message that the concatenation is cleared. If there is an entry in the /etc/vfstab file for this metadevice, delete that entry. You do not want to confuse the system by asking it to mount a file system on a non-existent metadevice.

Removing Mirrors

This section describes how to remove mirrors from the system.

Removing a mirror that is used by a file system that cannot be unmounted--such as root (/), swap, /opt, or /usr--essentially involves "unmirroring" the file system and mounting it on the underlying slice of one of the submirrors making up the mirror. Refer to "How to Unmirror a File System That Cannot Be Unmounted (Command Line)".


Note -

To remove a mirror and keep the same metadevice name as the mount device, refer to "Metadevice Name Switching".


Preliminary Information for Removing Mirrors

How to Remove a Mirror and Submirrors (DiskSuite Tool)

You can use this task for any file system or non-UFS application that uses a mirror, except for a file system that is root (/), swap, /opt, or /usr. To remove a mirror that is used by one of these file systems, refer to "How to Unmirror a File System That Cannot Be Unmounted (Command Line)".

  1. Make sure you have met the prerequisites ("Prerequisites for Removing DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Removing Mirrors").

  2. Make sure you have a current backup of the metadevice.

  3. Stop access to the metadevice.

    For example, a mirrored file system should be unmounted. For a non-UFS application, such as a database, perform the steps necessary to stop the application's use of the metadevice.

  4. Double-click the Mirror object in the Objects list.

    The mirror object appears on the canvas.

  5. Display the Mirror object's pop-up menu and choose Delete.

  6. Click the Really Delete button.

    The mirror is split into its underlying submirrors (Concat/Stripe metadevices).

  7. [Optional] If the mirror was used as a file system and there was an entry for the mirror in the etc/vfstab file, use one of the following to clean up the entry for the mirror.

    • You change the /etc/vfstab entry to mount the file system on one of the submirrors.

    • If one of the submirrors consists of a one-way concatenation, you can change the /etc/vfstab entry to mount the file system on the underlying slice.

    • If you do not plan on accessing the data anymore, you can remove the /etc/vfstab entry for the file system altogether.

  8. Clean up the Concat/Stripe objects.

    You should delete the submirror metadevice(s) that you no longer need.

  9. To verify that the objects were deleted, display the Configuration Log.

How to Remove a Mirror and Submirrors (Command Line)

You can use this task for any file system or non-UFS application that uses a mirror, except for a file system that is root (/), swap, /opt, or /usr. To remove a mirror that is used by one of these file systems, refer to "How to Unmirror a File System That Cannot Be Unmounted (Command Line)".

The high-level steps for this procedure are:

Example -- Removing a Mirror, Keeping the Data on a Submirror

After checking the prerequisites ("Prerequisites for Removing DiskSuite Objects"), and the preliminary information ("Preliminary Information for Removing Mirrors"), use the metadetach(1M) and metaclear(1M) commands to delete the metadevice. Refer to the metadetach(1M) and metaclear(1M) man pages for more information.


# metastat d2
d2: Mirror
    Submirror 0: d0
      State: Okay
    Submirror 1: d1
      State: Okay
...
# umount /news
# metadetach d2 d0
# metaclear d2
d2: Mirror is cleared
(Edit the /etc/vfstab file so that /news references submirror d0)
# mount /news
# metaclear d1
d1: Concat/Stripe is cleared

This example clears the mirror d2 that also contains a mounted file system. The mirror consists of submirrors d0 and d1. The metastat command reports that both submirrors are in the "Okay" state. The file system must be unmounted before the metadetach command detaches submirror d0 from mirror d2. The mirror is then cleared.

To continue to access data on submirror d0, the entry for the file system in the /etc/vfstab file is changed from the mirror to the concatenation (submirror) d0.

After cleaning up the /etc/vfstab file to reference submirror (concatenation) d0, the file system is remounted. (It is remounted on d0.) The other submirror, d1, is cleared with the metaclear command.

Removing RAID5 Metadevices

This section describes how to remove RAID5 metadevices from the system.


Caution - Caution -

Any data that is on the RAID5 metadevice is lost when it is removed from the system for good, and its underlying slices are reused. Data should be backed up if you need to save it.


Preliminary Information for Removing RAID5 Metadevices

How to Remove a RAID5 Metadevice (DiskSuite Tool)

  1. Make sure you have met the prerequisites ("Prerequisites for Removing DiskSuite Objects") and have read the preliminary information ("Preliminary Information for Removing RAID5 Metadevices").

  2. Make sure you have a current backup of the metadevice.

  3. Stop access to the RAID5 metadevice.

    For example, a file system should be unmounted. For a non-UFS application, such as a database, perform the steps necessary to stop the application's use of the metadevice.

  4. Double-click the RAID5 object to be deleted in the Objects list.

    The RAID5 object appears on the canvas.

  5. Display the RAID5 object's pop-up menu and select Delete.

  6. Click Really Delete on the dialog box that is displayed.

  7. [Optional] If there is an entry in the /etc/vfstab file for this metadevice, delete that entry.

    You do not want to confuse the system by asking it to mount a file system on a non-existent device.

  8. To verify that the object was deleted, display the Configuration Log.


    Note -

    Hot spare pools assigned to the metadevice are not deleted.


How to Remove a RAID5 Metadevice (Command Line)

After checking the prerequisites ("Prerequisites for Removing DiskSuite Objects"), and the preliminary information ("Preliminary Information for Removing RAID5 Metadevices"), use the metaclear(1M) command to delete the metadevice. Refer to the metaclear(1M) man page for more information.

Example -- Removing a RAID5 Metadevice


# umount /nfs
# metaclear d80
d80: RAID is cleared
(Edit the /etc/vfstab file)

This example clears the RAID5 metadevice d80 that also contains a mounted file system, /nfs. Access to d80 is stopped by unmounting its file system. The system displays a confirmation message that the RAID5 metadevice is cleared. If there is an entry in the /etc/vfstab file for this metadevice, it should be deleted. You do not want to confuse the system by attempting to mount a file system on a non-existent metadevice.

Removing Trans Metadevices

This section describes how to remove trans metadevices (UFS logging).


Note -

To remove a trans metadevice and keep the same metadevice name as the mount device, refer to "Metadevice Name Switching".


Preliminary Information for Removing Trans Metadevices

How to Remove a Trans Metadevice (DiskSuite Tool)

Use this task to remove UFS logging from a file system that can be unmounted.

  1. Make sure you have met the prerequisites ("Prerequisites for Removing DiskSuite Objects") and have read the preliminary information ("Preliminary Information for Removing Trans Metadevices").

  2. Make sure you have a current backup of the metadevice.

  3. Unmount the file system.

  4. Double-click the Trans Metadevice object in the Objects list.

    The trans metadevice object appears on the canvas.

  5. Display the Trans Metadevice object's pop-up menu and select Delete.

  6. Click the Really Delete button.

    The trans metadevice is split into its underlying master and logging devices.

  7. Edit the /etc/vfstab file, using one of the following:

    • If the master device is a metadevice, you can change the /etc/vfstab entry to mount the file system on the metadevice that serves as the master device.

    • If the master device is metadevice consisting of a single slice, you can change the /etc/vfstab entry to mount the file system on the metadevice's underlying slice.

    • If the master device is a slice, you can change the /etc/vfstab entry to mount the file system on the slice.

    • If you do not plan on accessing the data anymore, remove the /etc/vfstab entry for the file system altogether.

  8. To verify that the Trans Metadevice object was deleted, display the Configuration Log.

  9. Run the fsck(1M) command.

    Because the file system is no longer a logging device, you must run fsck before you can mount it. You run fsck either on the raw metadevice or raw device for the slice, depending on the configuration of the master device. Answer y to the following prompt:


    # fsck raw_device
    ...
    FILE SYSTEM STATE IN SUPERBLOCK IS WRONG; FIX? y
    ...

    Note -

    If you are mounting the file system on a metadevice, run fsck on the raw device for that metadevice. Otherwise, run fsck on the raw device for slice upon which you will mount the file system.


  10. Mount the file system.

    The file system is no longer being logged.

  11. [Optional] Clean up the master and logging devices.

    If the master and logging devices were metadevices, you should delete the metadevices that you no longer need.

How to Remove a Trans Metadevice (Command Line)

After checking the prerequisites ("Prerequisites for Removing DiskSuite Objects") and the preliminary information ("Preliminary Information for Removing Trans Metadevices"), use the metaclear(1M) command to remove the trans metadevice. Refer to the metaclear(1M) man page for more information.

Example -- Removing a Trans Metadevice


# umount /abcfs
# metaclear d64
(Edit the /etc/vfstab file)
# fsck /dev/rdsk/c0t2d0s6
...
FILE SYSTEM STATE IN SUPERBLOCK IS WRONG; FIX? y
...
# mount /abcfs

This example removes UFS logging from the /abcfs file system, which uses the trans metadevice d64. The underlying slice for the master device is /dev/dsk/c0t2d0s6. When the trans metadevice is cleared, any information pertaining to the master device is rolled from the log prior to clearing the device. The entry for the file system in the /etc/vfstab file must be changed so that it references the block and raw devices containing the file system rather than the metadevice name for the trans metadevice. Because the file system is no longer a logging device, the fsck(1M) command is run before mounting it. The FIX? prompt is responded to with a y, then the file system is mounted on the underlying slice.

How to Remove a Trans Metadevice From a File System That Cannot Be Unmounted (DiskSuite Tool)

Use this procedure to remove UFS logging from a file system that cannot be unmounted, such as root (/), /usr, and swap.

  1. Make sure you have met the prerequisites ("Prerequisites for Removing DiskSuite Objects") and have read the preliminary information ("Preliminary Information for Removing Trans Metadevices").

  2. Make sure you have a current backup of the metadevice.

  3. Double-click the Trans Metadevice object in the Objects list.

    The object appears on the canvas.

  4. Drag the logging device out of the Trans Metadevice object to the canvas.

    The status of the object changes to "Detach log (scheduled)."

  5. Click inside the top rectangle of the Trans Metadevice object then click Commit.

    A dialog box warns that the logging device will be detached after the trans metadevice is unmounted or after the next reboot. Click Really Commit.

    The status of the trans metadevice changes to "Detach log (in-progress)."


    Note -

    If an entry exists for the file system in the /etc/vfstab file, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the slice name instead of the trans metadevice name.


  6. Reboot. You may see a message indicating that the file system is being checked.


    ...
    The /usr file system (/dev/md/rdsk/d0) is being checked.
    /dev/md/rdsk/d0: 11576 files, 198318 used, 42081 free
    /dev/md/rdsk/d0: (737 frags, 5168 blocks, 0.3% fragmentation)
    ...
  7. Edit the /etc/vfstab file to remove the trans metadevice.

    Change the entry for the file system so that it references the block and raw devices containing the file system rather than the trans metadevice.

  8. Reboot.

    This reboot enables the system to recognize that the file system is no longer mounted on the trans metadevice but on its underlying slice.

  9. To delete the trans metadevice, double-click the Trans Metadevice object in the Objects list. The object appears on the canvas. Point inside the top rectangle of the object and display the pull-down menu. Choose the Delete option.

  10. Click the Really Delete button on the Confirmation dialog box that appears.

  11. To verify that the Trans Metadevice object was deleted, display the Configuration Log.

How to Remove a Trans Metadevice From a File System That Cannot Be Unmounted (Command Line)

After checking the prerequisites ("Prerequisites for Removing DiskSuite Objects") and the preliminary information ("Preliminary Information for Removing Trans Metadevices"), use the metadetach(1M) and metaclear(1M) commands to remove the trans metadevice. Refer to the metadetach(1M) and metaclear(1M) man pages for more information.

Use this procedure to remove a trans metadevice from a file system, such as /usr, that cannot be unmounted during normal system operation.

Example -- Removing a Trans Metadevice from /usr


# metadetach -f d20
d20: logging device c0t0d0s1 will be detached at unmount or reboot
# reboot
...
The /usr file system (/dev/rdsk/c0t3d0s3) is being checked.
...
(Edit the /etc/vfstab file)
# reboot
...
# metaclear d20
d20: Trans is cleared

In this example, d20 is a trans metadevice providing UFS logging for the /usr file system. To remove logging, the metadetach command is run with the -f option to force a detach of the logging device, and the system is rebooted. Next, the /etc/vfstab file is edited to change the entry for the file system so that it references the slice containing the file system rather than the trans metadevice. Another reboot places the /usr file system on its new mount device. The metaclear command clears the trans metadevice d20 from the system.

Removing Hot Spares and Hot Spare Pools

This section describes how to remove hot spares and hot spare pools from the system.

Preliminary Information for Removing Hot Spares and Hot Spare Pools

How to Remove a Hot Spare From a Hot Spare Pool (DiskSuite Tool)

  1. Make sure you have met the prerequisites ("Prerequisites for Removing DiskSuite Objects") and have read the preliminary information ("Preliminary Information for Removing Hot Spares and Hot Spare Pools").

  2. Double-click the Hot Spare Pool object in the Objects list.

    The object appears on the canvas.

  3. Drag the hot spare slice that you want to remove from the Hot Spare Pool object to the canvas.

  4. Click inside the top rectangle of the Hot Spare Pool object then click Commit.

  5. To verify that the hot spare pool was committed, display the Configuration Log.

How to Remove a Hot Spare From a Hot Spare Pool (Command Line)

After checking the prerequisites ("Prerequisites for Removing DiskSuite Objects") and the preliminary information ("Preliminary Information for Removing Hot Spares and Hot Spare Pools"), use the metahs(1M) command to remove the hot spare. Refer to the metahs(1M) man page for more information.

Example -- Removing a Hot Spare From a Hot Spare Pool


# metahs -d hsp003 /dev/dsk/c2t1d0s2
hsp003: Hotspare is deleted

This example removes the hot spare /dev/dsk/c2t1d0s2 from the hot spare pool hsp003.

Example -- Removing a Hot Spare From All Hot Spare Pools


# metahs -d all /dev/dsk/c2t1d0s2
hsp003: Hotspare is deleted
hsp004: Hotspare is deleted
# metahs -i
...
hsp003: 2 hot spares
        c1t3d0s6                Available       912800 blocks
        c0t0d0s4                Available       5600 blocks
 
hsp004: 2 hot spares
        c1t3d0s6                Available       912800 blocks
        c0t0d0s4                Available       5600 blocks

This example removes the hot spare /dev/dsk/c2t1d0s2 from all its associated hot spare pools. The metahs command with the -i option shows that the hot spare slice is no longer part of the hot spare pools from which it was deleted.

How to Remove a Hot Spare Pool (DiskSuite Tool)

Before you can remove a hot spare pool you must remove all associations to submirrors and RAID5 metadevices.

  1. Make sure you have met the prerequisites ("Prerequisites for Removing DiskSuite Objects") and have read the preliminary information ("Preliminary Information for Removing Hot Spares and Hot Spare Pools").

  2. Select Hot Spare Pools from the Browse menu to display the Hot Spare Pool Browser window.

  3. Double-click the hot spare pool in the scrolling list that you want to delete.

    The Hot Spare Pool Information window for that hot spare pool appears. An "Associated With" listing displays all the metadevices using the hot spare pool.

  4. Remove the hot spare pool association for each metadevice (submirror or RAID5 metadevice) in the Associated With list.

    1. One by one, double-click each metadevice in the Associated With list.

      The appropriate Information window appears.

    2. Click Remove. The Hot Spare Pool field becomes blank. Then click Close.

    3. Repeat 4a and 4b for each metadevice in the Associated With list.

    4. When finished removing the hot spare pool association for each metadevice, click Close on the Hot Spare Pool Information window.

  5. Commit each mirror or RAID5 device that had its hot spare pool association removed.

    The "Use" status of the hot spare pool changes to "None."

  6. Double-click the Hot Spare Pool object in the Objects list to display it on the canvas.

  7. Delete the hot spare pool.

    Display the object's pop-up window and choose Delete.

  8. To verify that the hot spare pool was deleted, display the Configuration Log.

How to Remove a Hot Spare Pool (Command Line)

After checking the prerequisites ("Prerequisites for Removing DiskSuite Objects") and the preliminary information ("Preliminary Information for Removing Hot Spares and Hot Spare Pools"), use the metaparam(1M) and metahs(1M) commands to remove a hot spare pool. For more information, refer to the metaparam(1M) and metahs(1M) man pages.

Example -- Removing a Hot Spare Pool


# metastat
...
d30: Mirror
    State: Okay
...
d31: Submirror of d30
    Hot spare pool: hsp001
...
d32: Submirror of d30
    Hot spare pool: hsp001
...
# metaparam -h none d30
# metaparam -h none d31
# metahs -d hsp001
hsp001: Hotspare pool is cleared

This example shows how the hot spare pool hsp001 is removed. To find out the hot spare pool associations, use the metastat command. The metastat output shows two submirrors, d31 and d32, using hot spare pool hsp001. The metaparam command with the -h and none options removes the association to the hot spare pool, first for submirror d31, then d32. When the hot spare pool has no more associations, it is removed with the metahs -d command.

Removing Disksets

This section describes how to remove disksets from the system.

Preliminary Information for Removing Hosts and Disks From Disksets

How to Remove a Host From a Diskset (Command Line)

  1. Make sure you have met the prerequisites ("Prerequisites for Removing DiskSuite Objects") and have read the preliminary information ("Preliminary Information for Removing Hosts and Disks From Disksets").

  2. Remove a host from a diskset by using the metaset(1M) command.


    # metaset -s diskset -d -h host
    

    In this command,

    -s diskset

    Specifies the name of a diskset on which metaset will work.

    -d

    Deletes the specified host. 

    -h host

    Specifies one or more hostnames to be deleted from the diskset. The hostname is the same name found in /etc/nodename.

  3. To verify that a host has been removed from the diskset, use the metaset(1M) command without any options.


    # metaset
    

Example -- Removing a Host from a Diskset


red# metaset -s relo-red -d -h blue
red# metaset
 
Set name = relo-red, Set number = 1
Host                Owner
  red                Yes
...

This example removes the host blue from the diskset relo-red.

How to Remove a Drive From a Diskset (Command Line)

  1. Make sure you have met the prerequisites ("Prerequisites for Removing DiskSuite Objects") and have read the preliminary information ("Preliminary Information for Removing Hosts and Disks From Disksets").

  2. Remove the drive from the diskset by using the metaset(1M) command.


    # metaset -s diskset -d [-f] drive...
    

    In this command,

    -s diskset

    Specifies the name of a diskset on which metaset will work.

    -d

    Deletes the specified drivename(s). 

    -f

    Forces the deletion of the last drive in the diskset, because this drive would implicitly contain the last state database replica. 

    drive

    Specifies the drive(s) to be deleted from the diskset. They must be in the form cxtxdx with no slice specified.


    Note -

    Use the -f option to delete the last drive in the diskset.


  3. To verify that a drive has been removed from the diskset, use the metaset(1M) command.

Example -- Removing a Drive from a Diskset


red# metaset -s relo-red -d c2t5d0
red# metaset
...
Host                Owner
  red                Yes
  blue
 
Drive               Dbase
  c1t2d0             Yes
  c1t3d0             Yes
  c2t2d0             Yes
  c2t3d0             Yes
  c2t4d0             Yes

This example removes drive c2t5d0 from diskset relo-red. The metaset command confirms that the deleted drive is no longer part of the diskset.

How to Remove a Diskset (Command Line)

Removing a diskset completely means:

Example -- Removing a Diskset

After checking the prerequisites ("Prerequisites for Removing DiskSuite Objects"), and the preliminary information ("Preliminary Information for Removing Hosts and Disks From Disksets"), use the metaclear(1M) and metaset(1M) commands to completely remove a diskset. Refer to the metaclear(1M) and metaset(1M) man pages for more information.


red# metaclear -s relo-red -a
red# metaset -s relo-red -d -h blue
red# metaset -s relo-red -f -d c1t2d0 c1t3d0 c2t2d0 c2t3d0 c2t4d0 c2t5d0
red# metaset -s relo-red -d -h red

The metaclear -a command clears (removes) all metadevices and hot spare pools from the relo-red diskset. Next, host blue is deleted from the diskset, followed by the shared disk drives. Finally, the last host in the set, in this case, red, is deleted from the diskset. This last command removes the diskset from the system.