This section describes how to create initial state database replicas based on your system configuration.
A state database replica stores DiskSuite configuration and state information. Before you can use DiskSuite, you must create state database replicas.
At least three state database replicas should be created. The system will stay running with exactly half or more state database replicas available at any one time. The system will panic when less than half the state database replicas are available. The system will not reboot without one more than half the total state database replicas. Instead, it will go into single-user mode for administrative tasks.
Use Table 1-1 to estimate the number of state database replicas required based on the number of hard drives in your system. Adjust it to meet your needs.
Table 1-1 Estimating Number of State Database Replicas Required
In a two-drive configuration, always create two state database replicas on each drive. For example, assume you create two state database replicas on one slice and only one state database replica on the other. If the slice with two state database replicas fails, DiskSuite will not function because the remaining slice only has one state database replica. Refer to Solstice DiskSuite 4.2.1 Reference Guide for more information on the operation of state database replicas.
You can create state database replicas on either a dedicated slice, or on a slice that will be used as part of a simple metadevice, RAID5 metadevice, or trans metadevice. Refer to Solstice DiskSuite 4.2.1 Reference Guide for guidelines on planning the location of state database replicas.
The maximum number of state database replicas is 50. This also applies to replicas that are part of a diskset.
Use one of the following three methods to create your initial state database replicas. The methods depend on how the slices on your system are configured. If your system has no available slices, or if you cannot repartition existing slices, you will not be able to use DiskSuite software.
Starting from scratch: If you have a new system, the easiest way to create state database replicas is to put them on slices that will become part of a simple metadevice (stripe/concatenation), RAID5 metadevice, or trans metadevice. A state database replica cannot be part of root (/), swap, /usr, an existing file system, or a slice containing data.
If you have a new system, refer to "How to Create Initial State Database Replicas From Scratch (DiskSuite Tool)".
When you combine state database replicas and metadevices on the same slice, DiskSuite detects the state database replica and adjusts the starting address and size of the metadevice accordingly. The advantage to this method is that you don't have to do anything extra, such as repartitioning a slice, and you don't have to worry about wasting space on a slice by having to dedicate it to just the state database replica.
Starting with existing unused slices: If your existing configuration has unused dedicated slices, put the state database replicas on those slices.
You may find, however, that the state database replicas are relatively small (517 Kbytes, or 1034 sectors), so you don`t want to dedicate a large slice just to hold the small state database replica. You may have to make some slices smaller than they currently are.
If you have existing, unused slices, refer to "How to Create Initial State Database Replicas on Existing Unused Slices (DiskSuite Tool)".
Starting with no unused slices: If your existing configuration has no available slices, you need to "steal" space from another slice, such as swap, for the state database replicas. If this is the case, refer to "How to Create State Database Replicas by Allocating Space From the swap Partition".
Never try to put a state database replica on a slice that is in use by a file system or database; this will destroy any existing data on that slice.
The prerequisites for the tasks in this section are:
Have a current backup of all data.
Have Solstice DiskSuite 4.2.1 software installed. (Refer to the Product Installation and Release Notes to install DiskSuite.)
Have root privilege.
This procedure directs you to use three windows in DiskSuite Tool to identify and view your configuration, and then put state database replicas on slices.
Make sure you have met the prerequisites ("Prerequisites for Creating State Database Replicas"), and have read the preliminary information ("Preliminary Information for Creating State Database Replicas").
Decide how many state database replicas you need, based on Table 1-1.
As root, start DiskSuite Tool to identify and view your configuration.
# metatool & |
The first time you run DiskSuite, you see the following message. Click OK to continue.
From the Objects list, drag the MetaDB object onto the canvas.
Use the ADJUST mouse button (by default, the middle button) to drag the object.
The MetaDB object represents or "contains" all the state database replicas in your configuration. Because you are starting from scratch, the MetaDB object has a "Critical" label on it to show you that you need to add state database replicas to it.
Click Disk View to display the Disk View window.
Select View All Controllers from the View menu in the Disk View window.
This shows your storage configuration: controllers, disks, and slices. You may want to use the View menu on the Disk View window to set the view to 50, 100, or 200 percent viewing. The default is 100 percent.
Click Slices to display the Slice Browser window.
This window shows the status and current use of slices. (The Disk View window's status line also displays this information when you position the cursor over the slice.)
Build a MetaDB object (create the state database replicas) by dragging available slices from the disks shown in the Disk View window, or from the Slice Browser window, over the MetaDB object in the canvas.
As long as the MetaDB object was selected when you opened the Disk View window, when a slice is put into the MetaDB object, the Disk View window colors the slice (blue on color screens, black on monochrome screens) that contains the state database replica. This helps you see where state replicas are located, for example, across controllers.
Try to balance state database replicas across controllers to achieve redundancy. For configurations with many disks, put a state database replica on each disk. (You can also click the Set Filters button in the Disk View window to filter for slices that are not in use.)
[Optional] To add multiple state database replicas to the same slice, display the MetaDB object's Info window, type the slice in the Slice field, type the number of replicas to add in the Replicas field, click Attach, then click Close.
This method does not enable you to "change" the number of state database replicas on a slice, only to initially specify them.
Select the MetaDB object, then click Commit.
To verify that the MetaDB object was committed, display the Configuration Log.
Select Configuration Log from the Browse menu.
This example shows a committed MetaDB object consisting of six slices, each containing one state database replica. The status of the MetaDB object is "OK," indicating that the state database replicas are spread across at least three controllers.
This task is the equivalent of the previous one. It demonstrates the use of the command line utilities to create state database replicas.
After checking the prerequisites ("Prerequisites for Creating State Database Replicas"), and the preliminary information ("Preliminary Information for Creating State Database Replicas"), use the metadb(1M) command to create state database replicas. Refer to the metadb(1M) man page for more information.
When you run the metadb(1M) command for the first time, the system displays a warning message that no state database replicas exist for this host. Ignore this message. It appears only when you create the state database replicas for the first time.
# metadb -a -f c0t1d0s3 c1t1d0s3 c2t1d0s3 c3t1d0s3 c4t1d0s3 # metadb flags first blk block count a u 16 1034 /dev/dsk/c0t1d0s3 a u 16 1034 /dev/dsk/c1t1d0s3 a u 16 1034 /dev/dsk/c2t1d0s3 a u 16 1034 /dev/dsk/c3t1d0s3 a u 16 1034 /dev/dsk/c4t1d0s3 |
The -a and -f options are used together to create the initial state database replicas. Five initial state database replicas, one on each of five slices, are created. By spreading the state database replicas across controllers, you can increase metadevice performance and reliability. The metadb command checks that the replicas are active, as indicated by the -a flag.
# metadb -a -f -c 2 c0t1d0s3 c1t1d0s3 c2t1d0s3 # metadb flags first blk block count a u 16 1034 /dev/dsk/c0t1d0s3 a u 1050 1034 /dev/dsk/c0t1d0s3 a u 16 1034 /dev/dsk/c1t1d0s3 a u 1050 1034 /dev/dsk/c1t1d0s3 a u 16 1034 /dev/dsk/c2t1d0s3 a u 1050 1034 /dev/dsk/c2t1d0s3 |
The -a and -f options are used together to create the initial state database replicas. The -c 2 option puts two state database replicas on each specified slice, creating a total of six replicas. By spreading the state database replicas across controllers, you can increase metadevice performance and reliability. The metadb command checks that the replicas are active, as indicated by the -a flag.
# metadb -a -f -c 3 c0t0d0s3 # metadb flags first blk block count a u 16 1034 /dev/dsk/c0t0d0s3 a u 1050 1034 /dev/dsk/c0t0d0s3 a u 2084 1034 /dev/dsk/c0t0d0s3 |
The system in this example consists of only one disk. (DiskSuite is being installed for its UFS logging feature.) The -a and -f options are used together to create the initial state database replicas. The -c 3 option creates three state database replicas on the same slice on the system's only disk. The metadb command checks that the replicas are active, as indicated by the -a flag.
Use a one-disk configuration for state database replicas as a last resort, as it creates a single point-of-failure.
In this procedure, you will resize slices to hold state database replicas. Most slices are likely to be much larger than what is required for a state database replica. To prevent the waste of large amounts of disk space, you can take space from one slice and allocate it to an unused slice name or a new slice.
Make sure you have met the prerequisites ("Prerequisites for Creating State Database Replicas"), and have read the preliminary information ("Preliminary Information for Creating State Database Replicas"). Also be sure that you know what slices are in your configuration and the names of the slices that are not currently in use.
Decide how many state database replicas you need, based on Table 1-1.
Create at least one new "small" slice. You can use the format(1M) command, the fmthard(1M) command, or Storage Manager. See System Administration Guide, Volume I for information on managing disks and slices.
Make sure that the disk space assigned to the slice you are creating for the metadevice state database is not shared with another slice.
Reboot.
Follow Step 3 through Step 12 of "How to Create Initial State Database Replicas From Scratch (DiskSuite Tool)".
Use this procedure if you have no unused slices on which to put state database replicas. Even if you have no unused slices, you can create a new slice by taking space from the end of the swap partition and assigning it to an unused slice name.
Re-allocating space for a new slice can be done only on the swap partition. Attempting this process on a file system will cause the loss of data on that file system.
As root, halt the system and boot into single-user mode.
# halt ... ok boot -s ... INIT: SINGLE USER MODE Type Ctrl-d to proceed with normal startup, (or give root password for system maintenance):<root-password> Entering System Maintenance Mode Mar 12 16:52:38 su: 'su root' succeeded for root on /dev/syscon Sun Microsystems Inc. SunOS 5.5 Generic November 1995 |
Use the swap -l command to identify a system's swap areas. Activated swap devices or files are listed under the swapfile column.
# swap -l swapfile dev swaplo blocks free /dev/dsk/c0t2d0s1 32,17 8 205624 192704 |
Turn off swapping and verify that no slices are being used for swap.
# swap -d /dev/dsk/slice # swap -l |
Repartition the disk with the format(1M) command, the fmthard(1M) command, or Storage Manager, and reboot your system.
You will delete cylinders from the swap slice, then add the cylinders to a new slice name that is not being used.
Verify that the new slice exists by logging back into your system and using the prtvtoc(1M) command.
# prtvtoc /dev/rdsk/slice |
Follow Step 3 through Step 12 of "How to Create Initial State Database Replicas From Scratch (DiskSuite Tool)".
Using the Metadevice State Database Info window, create three state database replicas on the slice that you created by repartitioning swap.
This example shows a committed MetaDB object with three state database replicas on the same slice. Notice that the object indicates three state database replicas even though it contains only one slice. The status of the MetaDB object is "Attention," because the replicas are not spread across at least three controllers.