|
|
Removing Metadevices - (Using DiskSuite 4.2.1 Commands)
by Jeff Hunter, Sr. Database Administrator
Contents
Overview
Examining the Disks In Our Example
If you followed the examples in the article,
"Creating Metadevices - (Using DiskSuite 4.2.1 Commands)",
most of the disk configuration described below should already exist.
For all examples in this document,
I will be utilizing a Sun Blade 150 connected to a Sun StorEdge D1000 Disk
Array containing twelve 9GB / 10000 RPM / UltraSCSI disk drives for a total
disk array capacity of 108GB. The disk array is connected to the Sun Blade 150
using a Dual Differential Ultra/Wide SCSI (X6541A) Host Adapter.
In the Sun StorEdge D1000 Disk Array, the system identifies the drives
as follows:
d0 : RAID 0 - Stripe
Removing a State Database Replica
Removing a Stripe - (RAID 0)
The following example unmounts the file system from the metadevice, /d0,
and then uses the metaclear command to permanently remove the metadevice from the system.
Keep in mind that this example will remove the metadevice /d0 from the system
and all data stored on it!
Removing a Concatenation - (RAID 0)
The following example unmounts the file system from the metadevice, /d1,
and then uses the metaclear command to permanently remove the metadevice from the system.
Keep in mind that this example will remove the metadevice /d1 from the system
and all data stored on it!
Removing a Mirror - (RAID 1)
Unmirror a File System that Can be Unmounted
In this example, I have a two-way mirrored metadevice named d20. It consists
of two submirrors d21 and d22. This two-way mirror was created from an
already existing UFS file system mounted on /dev/dsk/c1t3d0s7. For the purpose of this
example, I want to unmirror the file system while preserving the data, remove all metadevices
that were involved in the mirrored metadevice, and return the file system back to normal to
where it existed; mounted on /dev/dsk/c1t3d0s7.
The following example unmounts the file system (/db20) from the
mirrored metadevice, d20. We then need to detach both submirrors
(d21 and d22) from the mirror using the metadetach command.
Finally, we use the metaclear command to permanently remove all metadevices from the system.
Keep in mind that this example will remove the mirrored metadevice d20
(plus the submirrors d21 and d22)
but will preserve the data that exists on /dev/dsk/c1t3d0s7 -
it just will not be mirrored!
In this example, I will unmirror the /usr file system. The twist here is that the
/usr file system (just like /opt and swap) cannot be unmounted during
normal system usage. The /usr file system is currently mounted on a two-way mirrored metadevice
named d20 that consists of two submirrors d21 and d22.
Before I created this two-way mirror for the /usr file system, the file system
was mounted on the slice /dev/dsk/c0t0d0s6. For the purpose of this
example, I want to unmirror the file system while preserving the data for the /usr
file system, remove all metadevices
that were involved in the mirrored metadevice, and return the file system back to normal to
where it existed; mounted on /dev/dsk/c0t0d0s6. The second part of the mirror (submirror2)
is /dev/dsk/c2t3d0s7 and will be made available for other uses after it is no longer part of the
mirror.
In this example, I will unmirror the swap file system. The twist here is that the
swap file system (just like /opt and /var) cannot be unmounted during
normal system usage. The swap file system is currently mounted on a two-way mirrored metadevice
named d20 that consists of two submirrors d21 and d22.
Before I created this two-way mirror for the swap file system, the file system
was mounted on the slice /dev/dsk/c0t0d0s3. For the purpose of this
example, I want to unmirror the swap file system, remove all metadevices
that were involved in the mirrored metadevice, and return the file system back to normal to
where it existed; mounted on /dev/dsk/c0t0d0s3. The second part of the mirror (submirror2)
is /dev/dsk/c2t3d0s7 and will be made available for other uses after it is no longer part of the
mirror.
In this example, I will unmirror the root (/) file system. The twist here is that the
root file system (just like /opt and swap) cannot be unmounted during
normal system usage. The root file system is currently mounted on a two-way mirrored metadevice
named d20 that consists of two submirrors d21 and d22.
Before I created this two-way mirror for the root file system, the file system
was mounted on the slice /dev/dsk/c0t0d0s0. For the purpose of this
example, I want to unmirror the file system while preserving the data for the root
file system, remove all metadevices
that were involved in the mirrored metadevice, and return the file system back to normal to
where it existed; mounted on /dev/dsk/c0t0d0s0. The second part of the mirror (submirror2)
is /dev/dsk/c0t2d0s0 and will be made available for other uses after it is no longer part of the
mirror.
Removing a RAID5 Volume - (RAID 5)
The following example unmounts the file system from the newly created metadevice, /d3,
and then uses the metaclear command to permanently remove the metadevice from the system.
Keep in mind that this example will remove the metadevice /d3 from the system
and all data stored on it!
Removing a Trans Metadevice
Any information pertaining to the master device is rolled from the log device prior
to removing the trans metadevice.
This section will contain the following two examples for removing Trans Metadevices:
Remove a Trans Metadevice From a File System That Can Be Unmounted
Removing a Hot Spare
This article provides a comprehensive overview for removing
DiskSuite metadevices (stripes, concatenations, mirrors, trans metadevices, and hot spares) using the
DiskSuite command-line tools. Most of the information in this article was taken
directly from the
"Solstice DiskSuite 4.2.1 User's Guide"
(Part Number 806-3205-10).
This article is all about providing definitions and examples of
DiskSuite's command line tools.
Controller 1 Controller 2
c1t0d0 - (d0)
c2t0d0 - (d0)
c1t1d0 - (d0)
c2t1d0 - (d1)
c1t2d0 - (d1)
c2t2d0 - (d1)
c1t3d0 - (d20)
c2t3d0 - (d20)
c1t4d0 - (d3)
c2t4d0 - (d3)
c1t5d0 - (d3)
c2t5d0 - (d4)
d1 : RAID 0 - Concatenation
d20 : RAID 1 - Mirror
d3 : RAID 5
d4 : Hot Spare
# metadb -d c2t4d0s7
The -d deletes all replicas that are located on the specified
slice. The /etc/system file is automatically updated
with the new information and the /etc/lvm/mddb.cf file
is updated.
The process for removing a Striped Metadevice is fairly easy and straightforward. The same
method can be used for a concatenated and RAID 5 metadevice as well.
# umount /db0
/dev/md/dsk/d0 /dev/md/rdsk/d0 /db0 ufs 2 yes -
# rmdir /db0
# metaclear d0
d0: Concat/Stripe is cleared
# metastat d0
metastat: alex: d0: unit not set up
The process for removing a Concatenated Metadevice is fairly easy and straightforward. The same
method can be used for a striped and RAID 5 metadevice as well.
# umount /db1
/dev/md/dsk/d1 /dev/md/rdsk/d1 /db1 ufs 2 yes -
# rmdir /db1
# metaclear d1
d1: Concat/Stripe is cleared
# metastat d1
metastat: alex: d1: unit not set up
This section will contain the following four examples for unmirroring / removing mirrors:
The process for unmirroring a regular file system (one that can be unmounted)
is fairly easy and straightforward.
Unmirror a File System that Cannot be Unmounted
# umount /db20
/dev/dsk/c1t3d0s7 /dev/rdsk/c1t3d0s7 /db20 ufs 2 yes -
# /dev/md/dsk/d20 /dev/md/rdsk/d20 /db20 ufs 2 yes -
# metastat d20
d20: Mirror
Submirror 0: d21
State: Okay
Submirror 1: d22
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 17470215 blocks
d21: Submirror of d20
State: Okay
Size: 17470215 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c1t3d0s7 3591 Yes Okay
d22: Submirror of d20
State: Okay
Size: 17470215 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c2t3d0s7 3591 Yes Okay
# metadetach d20 d22
d20: submirror d22 is detached
# metadetach d20 d21
metadetach: alex: d20: attempt to detach last running submirror
# metaclear d22
d22: Concat/Stripe is cleared
# metaclear d20
d20: Mirror is cleared
# metaclear d21
d21: Concat/Stripe is cleared
# metastat d20 d21 d22
metastat: alex: d20: unit not set up
metastat: alex: d21: unit not set up
metastat: alex: d22: unit not set up
# mount /db20
The process for unmirroring a file system (one that cannot be unmounted)
is fairly easy and straightforward. Keep in mind that this process can be used
for the /usr, /opt, var, and swap file systems.
Unmirror swap
# metastat d20
d20: Mirror
Submirror 0: d21
State: Okay
Submirror 1: d22
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 16781040 blocks
d21: Submirror of d20
State: Okay
Size: 16781040 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c0t0d0s6 0 No Okay
d22: Submirror of d20
State: Okay
Size: 17470215 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c2t3d0s7 3591 Yes Okay
# metadetach d20 d22
d20: submirror d22 is detached
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /usr ufs 1 no -
# /dev/md/dsk/d20 /dev/md/rdsk/d20 /usr ufs 1 no -
# reboot
# metaclear -r d20
d20: Mirror is cleared
d21: Concat/Stripe is cleared
# metaclear d22
d22: Concat/Stripe is cleared
# metastat d20 d21 d22
metastat: alex: d20: unit not set up
metastat: alex: d21: unit not set up
metastat: alex: d22: unit not set up
The process for unmirroring the swap file system (one that cannot be unmounted)
is fairly easy and straightforward. Keep in mind that this process can be used
for the /usr, /opt, var, and swap file systems.
Unmirror root (/)
# metastat d20
d20: Mirror
Submirror 0: d21
State: Okay
Submirror 1: d22
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2101200 blocks
d21: Submirror of d20
State: Okay
Size: 2101200 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c0t0d0s3 0 No Okay
d22: Submirror of d20
State: Okay
Size: 17470215 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c2t3d0s7 3591 Yes Okay
# metadetach d20 d22
d20: submirror d22 is detached
/dev/dsk/c0t0d0s3 - - swap - no -
# /dev/md/dsk/d20 - - swap - no -
# reboot
# swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s3 136,3 16 2101184 2101184
# metaclear -r d20
d20: Mirror is cleared
d21: Concat/Stripe is cleared
# metaclear d22
d22: Concat/Stripe is cleared
# metastat d20 d21 d22
metastat: alex: d20: unit not set up
metastat: alex: d21: unit not set up
metastat: alex: d22: unit not set up
The process for unmirroring the root file system (keeping in mind that it cannot be unmounted)
is fairly easy and straightforward. Keep in mind that this process is very similar
to that used
for the /usr, /opt, var, and swap file systems.
# metastat d20
d20: Mirror
Submirror 0: d21
State: Okay
Submirror 1: d22
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 4198320 blocks
d21: Submirror of d20
State: Okay
Size: 4198320 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c0t0d0s0 0 No Okay
d22: Submirror of d20
State: Okay
Size: 10489680 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c0t2d0s0 0 No Okay
# metadetach d20 d22
d20: submirror d22 is detached
# metaroot /dev/dsk/c0t0d0s0
# reboot
# metaclear -r d20
d20: Mirror is cleared
d21: Concat/Stripe is cleared
# metaclear d22
d22: Concat/Stripe is cleared
# metastat d20 d21 d22
metastat: alex: d20: unit not set up
metastat: alex: d21: unit not set up
metastat: alex: d22: unit not set up
The process for removing a RAID5 Metadevice is fairly easy and straightforward. The same
method can be used for a sriped and concatenated metadevice as well.
# umount /db3
/dev/md/dsk/d3 /dev/md/rdsk/d3 /db3 ufs 2 yes -
# rmdir /db3
# metaclear d3
d3: RAID is cleared
# metastat d3
metastat: alex: d3: unit not set up
When you remove a Trans Metadevice, you remove logging from the appropriate file systems.
The underlying data (and possibly a metadevice, if the master consists of one) on
the file systems is still preserved, unless you also remove that metadevice or
remove the slice.
Remove a Trans Metadevice From a File System That Cannot Be Unmounted
# umount /db0
# metaclear d5
d5: Trans is cleared
/dev/md/dsk/d0 /dev/md/rdsk/d0 /db0 ufs 2 yes -
# /dev/md/dsk/d5 /dev/md/rdsk/d5 /db0 ufs 2 yes -
# metastat d5
metastat: alex: d5: unit not set up
# fsck /dev/md/rdsk/d0
** /dev/md/rdsk/d0
** Last Mounted on /db0
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
FILE SYSTEM STATE IN SUPERBLOCK IS WRONG; FIX? y
2 files, 9 used, 25801767 free (15 frags, 3225219 blocks, 0.0% fragmentation)
# mount /db0
# metadetach -f d6
d6: logging device c1t1d0s0 will be detached at unmount or reboot
# reboot
...
The /usr file system (/dev/md/rdsk/d6) is being checked.
/dev/md/rdsk/d6: 38070 files, 791155 used, 7469602 free
/dev/md/rdsk/d6: (5058 frags, 933068 blocks, 0.0% fragmentation)
...
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /usr ufs 1 no -
# /dev/md/dsk/d6 /dev/md/rdsk/d6 /usr ufs 1 no -
# reboot
# metaclear d6
d6: Trans is cleared
# metastat d6
metastat: alex: d6: unit not set up
Last modified on: Tuesday, 26-Jul-2005 13:21:13 EDT
Page Count: 22358