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.
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.1 Reference.
Here are the prerequisites for the steps in this chapter:
To work with "local" metadevices (metadevices not in a diskset configuration), type:
---------------
# metatool & ---------------
To work with metadevices in a diskset, make sure you are the diskset owner and type:
---------------------------------
# metatool -s diskset_name & ---------------------------------
This section describes how to remove state database replicas from the system.
Drag the selected slice to the Metadevice Editor's canvas.
The status of the slice that contained the state database replica changes to Unassigned in the Slice Browser.
Select the slice that was dragged out of the MetaDB object and click Put Away. The slice is returned to the Slice Browser.
Note - A Warning message is displayed if you attempt to delete all state database replicas.
After checking the prerequisites, and the preliminary information, 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.
----------------------------------
# metadb -d c0t2d0s0 c0t1d0s0 ----------------------------------
This example deletes two state database replicas, located on slices /dev/dsk/c0t2d0s0 and /dev/dsk/c0t1d0s0.
-----------------------------------
# metadb -f -d c0t1d0s3 c4t1d0s3 -----------------------------------
This example deletes a system's remaining two state database replicas. The
-f option is needed.
This section describes how to remove stripes and concatenations from the system.
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.
The metadevice object appears on the canvas.
You do not want to confuse the system by asking it to mount a file system on a non-existent metadevice.
Note - Hot spare pools assigned to the metadevice are not deleted.
After checking the prerequisites, and the preliminary information, use the metaclear(1M) command to delete the metadevice. Refer to the metaclear(1M) man page for more information.
-----------------------------
# 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.
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."
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)."
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.
The mirror object appears on the canvas.
The mirror is split into its underlying submirrors (Concat/Stripe metadevices).
You should delete the submirror metadevice(s) that you no longer need.
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:
After checking the prerequisites, and the preliminary information, 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.
This section describes how to remove RAID5 metadevices from the system.
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.
The RAID5 object appears on the canvas.
You do not want to confuse the system by asking it to mount a file system on a non-existent device.
Note - Hot spare pools assigned to the metadevice are not deleted.
After checking the prerequisites, and the preliminary information, use the metaclear(1M) command to delete the metadevice. Refer to the metaclear(1M) man page for more information.
-----------------------------
# 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.
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."
Use this task to remove UFS logging from a file system that can be unmounted.
The trans metadevice object appears on the canvas.
The trans metadevice is split into its underlying master and logging devices.
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.
The file system is no longer being logged.
If the master and logging devices were metadevices, you should delete the metadevices that you no longer need.
After checking the prerequisites and the preliminary information, use the metaclear(1M) command to remove the trans metadevice. Refer to the metaclear(1M) man page for more information.
---------------------------------------------------
# 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.
Use this procedure to remove UFS logging from a file system that cannot be unmounted, such as root (/), /usr, and swap.
The object appears on the canvas.
The status of the object changes to "Detach log (scheduled)."
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.
---------------------------------------------------------------
... 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) ... ---------------------------------------------------------------
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.
This reboot enables the system to recognize that the file system is no longer mounted on the trans metadevice but on its underlying slice.
After checking the prerequisites and the preliminary information, 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.
--------------------------------------------------------------------
# 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.
This section describes how to remove hot spares and hot spare pools from the system.
The object appears on the canvas.
After checking the prerequisites and the preliminary information, use the metahs(1M) command to remove the hot spare. Refer to the metahs(1M) man page for more information.
---------------------------------------
# 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.
---------------------------------------------------------------
# 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.
Before you can remove a hot spare pool you must remove all associations to submirrors and RAID5 metadevices.
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.
The appropriate Information window appears.
The "Use" status of the hot spare pool changes to "None."
Display the object's pop-up window and choose Delete.
After checking the prerequisites and the preliminary information, 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.
----------------------------------
# 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.
This section describes how to remove disksets from the system.
--------------------------------------------
# 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. ------------------------------------------------------------------
------------
# metaset ------------
--------------------------------------
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.
-----------------------------------------------
# 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.
-------------------------------------
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.
Removing a diskset completely means:
After checking the prerequisites, and the preliminary information, 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.