Solstice DiskSuite 4.2.1 User's Guide

Chapter 2 Creating DiskSuite Objects

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

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

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

Overview of Creating DiskSuite Objects

When you create a DiskSuite object, you assign physical slices to a logical DiskSuite name. The DiskSuite objects that you can create using the steps in this chapter include:

For general information on DiskSuite, refer to Solstice DiskSuite 4.2.1 Reference Guide.


Note -

For hints on how to name metadevices, refer to "Metadevice Naming Conventions".


Prerequisites for Creating DiskSuite Objects

Here are the prerequisites for the steps in this chapter:

Creating Additional State Database Replicas

This section describes how to create additional state database replicas on a system that is up and running.

Preliminary Information for Creating Additional State Database Replicas

How to Create Additional State Database Replicas (DiskSuite Tool)

After the initial state database replicas are created, you can create additional state database replicas as needed.

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

  2. Double-click the MetaDB object in the Objects list.

    DiskSuite Tool displays the MetaDB object on the canvas.

  3. Click Slices to open the Slice Browser window.

  4. Select the slice(s) for the additional state database replica(s). Drag the slice(s) to the top rectangle of the MetaDB object.

    Use Control-click to select multiple slices.

  5. [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.

  6. Make sure that the MetaDB object is selected then click Commit.

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

Example -- Committed MetaDB Object

This example shows a new state database replica added to a MetaDB object.

Graphic

The added slice that contains the state database replica, c1t2d0s0, appears at the bottom of the list of slices in the committed MetaDB object.

How to Create Additional State Database Replicas (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Additional State Database Replicas"), use the metadb(1M) command to create additional state database replicas. Refer to the metadb(1M) man page for more information.

Example -- Adding a State Database Replica


# metadb -a c0t2d0s0
# metadb
        flags         first blk      block count
...
     a        u         16              1034            /dev/dsk/c0t2d0s0

The -a option adds the additional state database replica to the system. The metadb command checks that the replica is active, as indicated by the -a flag.

Example -- Adding Two State Database Replicas to the Same Slice


# metadb -a -c 2 c0t2d0s0
# metadb
        flags         first blk      block count
...
     a        u         16              1034            /dev/dsk/c0t2d0s0
     a        u         1050            1034            /dev/dsk/c0t2d0s0

The -a option adds additional state database replicas to the system. The -c 2 option places two replicas on the specified slice. The metadb command checks that the replicas are active, as indicated by the -a flag.

Creating Stripes and Concatenations

This section describes how to create stripes and concatenations. To concatenate (add slices) to an existing stripe, refer to "How to Expand an Existing Concat/Stripe (DiskSuite Tool)".

Preliminary Information for Creating Stripes and Concatenations


Note -

Because DiskSuite Tool uses the Concat/Stripe object to represent both concatenated metadevices and striped metadevices, the only way to distinguish them by a glance is to study the pattern of rectangles in the Concat/Stripe object.


How to Create a Striped Metadevice (DiskSuite Tool)


Caution - Caution -

Do not create a striped metadevice from an existing file system or data. Doing so will destroy data. To create a striped metadevice from existing data, you must dump and restore the data to the metadevice.


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

  2. Click the Concat/Stripe template to display an unassigned and uncommitted Concat/Stripe object on the canvas. The metadevice name is automatically assigned.

  3. [Optional] Change the default metadevice name.

    Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click the Attach button. Then click the Close button.

  4. Click Slices to open the Slice Browser window.

  5. Use Control-click to select multiple slices, and drag them into the Concat/Stripe object.

  6. Click Stripe on the "Stripe or Concat" dialog box that appears.


    Note -

    If you drag slices one at a time, the "Stripe or Concat" dialog box does not appear, so be careful where you drop them on the Concat/Stripe object. To create a stripe, drop the slices on the rectangle labeled "stripe 0 of dx."


  7. [Optional] To change the default interlace value of 16 Kbytes, point the cursor inside the rectangle where "stripe 0 of dx" is displayed, and display the pop-up Stripe Information window for this striped metadevice.

    Graphic
  8. To change the interlace value, click Custom and type the new value in the field next to the Custom button. This value can be in Kbytes, Mbytes, or sectors. You can configure it by using the drop-down menu beside this field. Click Attach to set the value, then click Close.

    For more information on setting the interlace value, refer to Solstice DiskSuite 4.2.1 Reference Guide.


    Note -

    The interlace value cannot be changed after committing the metadevice.


  9. Click the top rectangle of the Concat/Stripe object, then click Commit.

  10. To verify that striped metadevice was committed, display the Configuration Log.

Example -- Committed Stripe

This example shows a newly created stripe made of two slices. The Stripe object displays the slices on top of each other in a single rectangle. Compare the presentation of a concatenated metadevice with "Example -- Committed Concatenation Object".

Graphic

Where to Go From Here

To prepare the newly created stripe for a file system, refer to "How to Create a File System on a Metadevice (File System Manager)". An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.

How to Create a Striped Metadevice (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Stripes and Concatenations"), create the striped metadevice with the metainit(1M) command. Refer to the metainit(1M) man page for more information.


Caution - Caution -

Do not create a striped metadevice from an existing file system or data. Doing so will destroy data. To create a striped metadevice from existing data, you must dump and restore the data to the metadevice.


Example -- Creating a Striped Metadevice of Two Slices With a 32 Kbyte Interlace


# metainit d10 1 2 c0t1d0s2 c0t2d0s2 -i 32k
d10: Concat/Stripe is setup

The striped metadevice, d10, consists of a single stripe (the number 1) made of two slices (the number 2). The -i option sets the interlace to 32 Kbytes. (The interlace cannot be less than 8 Kbytes, nor greater than 100 Mbytes.) If interlace were not specified, the striped metadevice would use the default of 16 Kbytes. The system verifies that the Concat/Stripe object has been set up.

For more information on setting the interlace value, refer to Solstice DiskSuite 4.2.1 Reference Guide.

Example -- Creating a Striped Metadevice of Three Slices


# metainit d20 1 3 c0t1d0s2 c0t2d0s2 c0t3d0s2
d20: Concat/Stripe is setup

The striped metadevice, d20, consists of a single stripe (the number 1) made of three slices (the number 3). Because no interlace is specified, the striped metadevice uses the default of 16 Kbytes. The system verifies that the Concat/Stripe object has been set up.

Where to Go From Here

To prepare the newly created striped metadevice for a file system, refer to "How to Create a File System on a Metadevice (Command Line)". An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.

How to Create a Concatenation (DiskSuite Tool)

Use this procedure to create a concatenation from slices that do not contain any data. To concatenate existing data, such as a file system or a database, refer to "How to Expand a Slice Containing Existing Data (DiskSuite Tool)".

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

  2. Click the Concat/Stripe template.

    An unassigned and uncommitted Concat/Stripe object appears on the canvas. The metadevice name is automatically assigned.

  3. [Optional] Change the default metadevice name.

    Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.

  4. Click Slices to display the Slice Browser window.

  5. Use Control-click to select the slices to be concatenated and drag them into the Concat/Stripe object.

  6. Click Concat on the "Stripe or Concat?" dialog box that appears.

  7. Click the top rectangle of the Concat/Stripe object, then click Commit.

  8. To verify that concatenation was committed, display the Configuration Log.

Example -- Committed Concatenation Object

This example shows a newly created concatenation made of two slices. The object displays the slices in the concatenation so that each slice is in its own rectangle.

Graphic

Where to Go From Here

To prepare the newly created concatenation for a file system, refer to "How to Create a File System on a Metadevice (File System Manager)". An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.

How to Create a Concatenation (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Stripes and Concatenations"), use the metainit(1M) command to create the concatenation. For more information, refer to the metainit(1M) man page.

Do not use this procedure on an existing file system or data. To concatenate existing data, such as a file system or a database, refer to "How to Expand a Slice Containing Existing Data (Command Line)".

The following examples create concatenations that do not contain any existing data.

Example -- Creating a Concatenation of Two Slices


# metainit d25 2 1 c0t1d0s2 1 c0t2d0s2
d25: Concat/Stripe is setup

This example creates a concatenation, d25, consisting of two "stripes" (the number 2) each made of a single slice (the number 1 in front of each slice). The system verifies that the Concat/Stripe object has been set up.

Example -- Creating a Concatenation of Four Slices


# metainit d40 4 1 c0t1d0s2 1 c0t2d0s2 1 c0t2d0s3 1 c0t2d1s3
d40: Concat/Stripe is setup

This example creates a concatenation called d40 consisting of four "stripes" (the number 4) each made of a single slice (the number 1 in front of each slice). The system verifies that the Concat/Stripe object has been set up.

Where to Go From Here

To prepare the newly created concatenation for a file system, refer to "How to Create a File System on a Metadevice (Command Line)". An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.

Creating Mirrors

This section describes how to create a mirror from scratch, and how to mirror an existing file system, including root (/).


Note -

In the past, when creating a mirror for a file system, the mount point would change. Now, in certain instances, you can create mirrors without having to change the mount point. Refer to "How to Create a Mirror From an Existing Concat/Stripe (Command Line)" for more information.


Preliminary Information for Creating Mirrors

How to Create a Mirror From Unused Slices (DiskSuite Tool)

The high-level steps in this procedure are:

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

  2. Click the Mirror template.

    An unassigned and uncommitted Mirror object appears on the canvas. The metadevice name is automatically assigned.

  3. [Optional] Change the default metadevice name.

    Display the object's pop-up menu and select Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.

  4. To create a one-way mirror, drag the first Concat/Stripe object (submirror) from the Objects list into the Mirror template. Click the top rectangle of the mirror, then click Commit.

  5. To create a two-way mirror, drag the second Concat/Stripe object (submirror) from the Objects list into the Mirror. Click the top rectangle of the mirror then click Commit.

    A resync of the second submirror begins. The Mirror object displays the resync progress.

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

Example -- Committed Mirror Object

This example shows a committed mirror object, d5, consisting of two striped metadevices (submirrors), d3 and d4.

Graphic

Where to Go From Here

To prepare the newly created mirror for a file system, refer to "How to Create a File System on a Metadevice (File System Manager)". An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.

How to Create a Mirror From Unused Slices (Command Line)

The high-level steps in this procedure are:

Check the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Mirrors"), before beginning. Refer to the metainit(1M) and metattach(1M) man pages for more information.

Example -- Creating a Two-Way Mirror


# metainit d51 1 1 c0t0d0s2
d51: Concat/Stripe is setup
# metainit d52 1 1 c1t0d0s2
d52: Concat/Stripe is setup
# metainit d50 -m d51
d50: Mirror is setup
# metattach d50 d52
d50: Submirror d52 is attached

This example creates a two-way mirror, d50. The metainit(1M) command creates two submirrors (d51 and d52), which are actually concatenations. The metainit -m command creates the one-way mirror from the d51 concatenation. The metattach(1M) command attaches d52, creating a two-way mirror and causing a mirror resync. (Any data on the attached submirror is overwritten by the other submirror during the resync.) The system verifies that the objects are set up.

Where to Go From Here

To prepare a newly created mirror for a file system, refer to "How to Create a File System on a Metadevice (Command Line)". An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.

How to Create a Mirror From a File System That Can Be Unmounted (DiskSuite Tool)

Use this procedure to mirror file systems that can be unmounted.


Note -

Some file systems can be unmounted, while other file systems (like root (/), /usr, /opt, or swap) cannot be unmounted. To mirror these file systems, refer to "How to Create a Mirror From a File System That Cannot Be Unmounted (DiskSuite Tool)".


The high-level steps in this procedure are:


Caution - Caution -

Do not create a multi-way mirror at first. Instead, commit a one-way mirror, then drag the additional submirror to the mirror template and commit the mirror again. This procedure initiates a mirror resync, ensuring that data is not corrupted.


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

  2. Click Slices to display the Slice Browser window.

    DiskSuite Tool should display the file system's name next to the name of the slice upon which it is mounted. If you mount a file system after starting DiskSuite Tool, select Rescan Configuration from the File menu.

  3. Click the Concat/Stripe template.

    DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.

  4. [Optional] Change the default metadevice name.

    Display the object's pop-up menu and select Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.

  5. Drag the file system's slice from the Slice Browser window into the Concat/Stripe object.

    When the slice is dropped, a warning dialog box is displayed that the slice is mounted. Click Continue.

  6. Make sure the Concat/Stripe object is selected, then click Commit.

    Click Really Commit on the warning dialog box that appears. This creates a metadevice that contains the file system, which will be used as the first submirror.


    Note -

    If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the concatenation's name.


  7. Click the Concat/Stripe template.

    DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.

  8. [Optional] Change the default metadevice name.

    See Step 4.

  9. Drag a slice from the Slice Browser window into the Concat/Stripe object.

    Select an unused slice, a slice that contains a state database replica, or more than one slice that is the same size or greater as the existing file system.

  10. Make sure the Concat/Stripe object is selected, then click Commit.

    This creates a metadevice, which will be used as the second submirror.

  11. Click the Mirror template.

    DiskSuite Tool displays an unassigned and uncommitted mirror object on the canvas and gives it a metadevice name.

  12. [Optional] Change the default metadevice name.

    See Step 4.

  13. Drag the Concat/Stripe object containing the file system (created in Step 6) into the Mirror template. A warning dialog box appears. Click Continue.


    Note -

    If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the mirror's metadevice name.


  14. Click the top rectangle of the Mirror object, then click Commit.

    This creates the one-way mirror.

  15. Unmount the file system.

    For example, use the umount(1M) command, or File System Manager.

  16. Select Rescan Configuration from the File menu.

    DiskSuite Tool updates the file system's current mount status.

  17. Remount the file system on the mirror.

    For example, use the mount(1M) command or File System Manager. (The mount point has now changed from the slice name to the mirror name.)

  18. Select Rescan Configuration from the File menu.

    DiskSuite Tool updates the file system's mount point. The Mirror object shows that it is being used by the file system.

  19. Drag the second Concat/Stripe object (created in Step 10) into the Mirror object. Click on the top rectangle of the Mirror object then click Commit.

    Data from the first submirror is resynced to the second mirror automatically.

  20. To verify that the mirror was committed, display the Configuration Log.

Example -- Committed Mirror Object with a Mounted File System

This example shows a committed two-way mirror consisting of submirrors d0 and d7, which in turn consist of slices c1t1d0s2 and c2t1d0s2, respectively. The file system, /fs1, is mounted on the mirror, d2.

Graphic

How to Create a Mirror From a File System That Can Be Unmounted (Command Line)

Use this procedure to mirror an existing file system that can be unmounted.


Note -

To use the command line to mirror /usr, /opt, or swap, refer to "How to Create a Mirror From a File System That Cannot Be Unmounted (Command Line)". To use the command line to mirror root (/), refer to "SPARC: How to Create a Mirror From root (/) (Command Line)", or "x86: How to Create a Mirror From root (/) (Command Line)".


The high-level steps in this procedure are:

Check the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Mirrors"), before beginning. Refer to the metainit(1M) and metattach(1M) man pages for more information.


Caution - Caution -

Do not create a multi-way mirror. Rather, create a one-way mirror with the metainit(1M) command then attach the additional submirrors with the metattach(1M) command. When the metattach(1M) command is not used, no resync operations occur and data could become corrupted. Also, do not create a two-mirror for a file system without first unmounting the file system and editing the /etc/vfstab file to reference the mirror metadevice before attaching the second submirror.


Example -- Creating a Two-Way Mirror


# metainit -f d1 1 1 c1t0d0s0
d1: Concat/Stripe is setup
# metainit d2 1 1 c2t0d0s0
d2: Concat/Stripe is setup
# metainit d0 -m d1
d0: Mirror is setup
# umount /master
(Edit the /etc/vfstab file so that the file system references the mirror)
# mount /master
# metattach d0 d2
d0: Submirror d2 is attached

The -f option forces the creation of the first concatenation, d1, which contains the mounted file system /master on /dev/dsk/c1t0d0s0. The second concatenation, d2, is created from /dev/dsk/c2t0d0s0. (This slice must be the same size or greater than that of d1.) The metainit command with the -m option creates the one-way mirror, d0, from d1.

Next, /master is unmounted and its entry changed in the /etc/vfstab file to reference the mirror. For example, the following line:


/dev/dsk/c1t0d0s0 /dev/rdsk/c1t0d0s0 /master ufs 2 yes -

should be changed to:


/dev/md/dsk/d0 /dev/md/rdsk/d0 /master ufs 2 yes -

Finally, the /master file system is remounted and submirror d2 attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d2 is attached.)

How to Create a Mirror From a File System That Cannot Be Unmounted (DiskSuite Tool)

Use this procedure to mirror file systems, such as root (/), /usr, /opt, and swap, that cannot be unmounted during normal system usage.

The high-level steps in this procedure are:


Note -

When mirroring root (/), it is essential that you record the secondary root slice name to reboot the system if the primary submirror fails. This information should be written down, not recorded on the system, which may not be available. See Chapter 7, Troubleshooting the System for details on recording the alternate boot device, and on booting from the alternate boot device.


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

  2. Click the Concat/Stripe template.

    DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.

  3. [Optional] Change the default metadevice name.

    Display the object's pop-up menu and select Info. Type the new metadevice name in the Device Name field and click the Attach button. Then click the Close button.

  4. Click Slices to display the Slice Browser window.

  5. Drag the slice containing the file system you want to mirror to the top rectangle of the Concat/Stripe object.

    When you drop the slice, DiskSuite Tool displays a warning dialog box. Click the Continue button.

  6. Click the top rectangle of the Concat/Stripe object, then click Commit.

    Click the Really Commit button if DiskSuite Tool displays a warning dialog box. This creates a one-way concatenation that contains the file system, which will be used as the first submirror.


    Note -

    If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the concatenation's metadevice name.


  7. Click the Concat/Stripe template.

    DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.

  8. [Optional] Change the default metadevice name.

    See Step 3.

  9. Drag a slice from the Slice Browser window to this Concat/Stripe object.

    When creating this one-way concatenated metadevice, use an unused slice that is the same size as or greater than the existing file system.

  10. Click the top rectangle of the Concat/Stripe object then click Commit.

    This creates the second submirror.

  11. Click the Mirror template.

    DiskSuite Tool displays an unassigned and uncommitted Mirror object on the canvas and gives it a metadevice name.

  12. [Optional] Change the default metadevice name.

    See Step 3.

  13. Drag the Concat/Stripe object that contains the file system into the Mirror template.

    Click the Continue button if DiskSuite Tool displays a warning dialog box.


    Note -

    If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the mirror's metadevice name.


  14. Click the top rectangle of the Mirror object then click Commit.

  15. Reboot.

  16. Restart DiskSuite Tool.

  17. Drag the second Concat/Stripe object created in Step 10 into the Mirror object to create the two-way mirror. Then click Commit.

    Data from the first submirror is resynced to the second mirror.

  18. If you are mirroring root (/), record the alternate boot path.

    Refer to Chapter 7, Troubleshooting the System for more information.

  19. To verify that the mirror was committed, display the Configuration Log.

Example -- Committed Mirror for /usr

This example shows a committed mirror containing the /usr file system.

Graphic

How to Create a Mirror From a File System That Cannot Be Unmounted (Command Line)

Use this procedure to mirror file systems, such as /usr, /opt, and swap, that cannot be unmounted during normal system usage.

To save the crash dump when you have mirrored swap, use the dumpadm(1M) command to configure the dump device as a metadevice. For instance, if the swap device is named /dev/md/dsk/d2, use dumpadmdumpadm to set this as the dump device.


Note -

To use the command line to mirror root (/), refer to "SPARC: How to Create a Mirror From root (/) (Command Line)", or "x86: How to Create a Mirror From root (/) (Command Line)".


The high-level steps in this procedure are:


Caution - Caution -

Do not create a multi-way mirror. Rather, create a one-way mirror with the metainit(1M) command, then attach the additional submirrors with the metattach(1M) command. When the metattach(1M) command is not used, no mirror resync occurs and data could become corrupted.


After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Mirrors"), use the metainit(1M) and metattach(1M) commands to create the mirror.

Example -- Creating a Mirror From /usr


# metainit -f d12 1 1 c0t3d0s6
d12: Concat/Stripe is setup
# metainit d22 1 1 c1t0d0s6
d22: Concat/Stripe is setup
# metainit d2 -m d12
d2: Mirror is setup
(Edit the /etc/vfstab file so that /usr references the mirror)
# reboot
...
# metattach d2 d22
d2: Submirror d22 is attached

The -f option forces the creation of the first concatenation, d12, which contains the mounted file system /usr on /dev/dsk/c0t3d0s6. The second concatenation, d22, is created from /dev/dsk/c1t0d0s6. (This slice must be the same size or greater than that of d12.) The metainit command with the -m option creates the one-way mirror d2 using the concatenation containing /usr. Next, the /etc/vfstab file must be edited to change the entry for /usr to reference the mirror. For example, the following line:


/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 1 yes -

should be changed to:


/dev/md/dsk/d2 /dev/md/rdsk/d2 /usr ufs 1 yes -

After a reboot, the second submirror d22 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d22 is attached.)

Example -- Creating a Mirror From swap


# metainit -f d11 1 1 c0t0d0s1
d11: Concat/Stripe is setup
# metainit d21 1 1 c1t0d0s1
d21: Concat/Stripe is setup
# metainit d1 -m d11
d1: Mirror is setup
(Edit the /etc/vfstab file so that swap references the mirror)
# reboot
...
# metattach d1 d21
d1: Submirror d21 is attached

The -f option forces the creation of the first concatenation, d11, which contains the mounted file system swap on /dev/dsk/c0t0d0s1. The second concatenation, d21, is created from /dev/dsk/c1t0d0s1. (This slice must be the same size or greater than that of d11.) The metainit command with the -m option creates the one-way mirror d1 using the concatenation containing swap. Next, if there is an entry for swap in the /etc/vfstab file, it must be edited to reference the mirror. For example, the following line:


/dev/dsk/c0t0d0s1 - - swap - no -

should be changed to:


/dev/md/dsk/d1 - - swap - no -

After a reboot, the second submirror d21 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d21 is attached.)

SPARC: How to Create a Mirror From root (/) (Command Line)

Use this task to mirror root (/) on a SPARC system.


Note -

The task for using the command line to mirror root (/) on an x86 system is different from the task used for a SPARC system. To mirror root (/) on an x86 system, refer to "x86: How to Create a Mirror From root (/) (Command Line)". When mirroring root (/), it is essential that you record the secondary root slice name to reboot the system if the primary submirror fails. This information should be written down, not recorded on the system, which may not be available. See Chapter 7, Troubleshooting the System for details on recording the alternate boot device, and on booting from the alternate boot device.


The high-level steps in this procedure are:

Make sure you have met the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Creating Mirrors"). For more information refer to the metainit(1M), metaroot(1M), and metattach(1M) man pages.

Example -- SPARC: Creating a Mirror From root (/)


# metainit -f d11 1 1 c0t3d0s0
d11: Concat/Stripe is setup
# metainit d12 1 1 c1t3d0s0
d12: Concat/Stripe is setup
# metainit d10 -m d11
d10: Mirror is setup
# metaroot d10
# lockfs -fa
# reboot
...
# metattach d10 d12
d10: Submirror d12 is attached
# ls -l /dev/rdsk/c1t3d0s0
lrwxrwxrwx   1 root     root          88 Feb  8 15:51 /dev/rdsk/c1t3d0s0 ->
../../devices/iommu@f,e0000000/vme@f,df010000/SUNW,pn@4d,1080000/ipi3sc@0,0/i
d@3,0:a,raw

The -f option forces the creation of the first concatenation, d11, which contains the mounted file system root (/) on /dev/dsk/c0t3d0s0. The second concatenation, d12, is created from /dev/dsk/c1t3d0s0. (This slice must be the same size or greater than that of d11.) The metainit command with the -m option creates the one-way mirror d10 using the concatenation containing root (/). Next, the metaroot command edits the /etc/vfstab and /etc/system files so that the system may be booted with the root file system (/) on a metadevice. (It is a good idea to run lockfs -fa before rebooting.) After a reboot, the submirror d12 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d12 is attached.) The ls -l command is run on the root raw device to determine the path to the alternate root device in case the system needs to be booted from it.

x86: How to Create a Mirror From root (/) (Command Line)

Use this task to mirror root (/) on an x86 system.


Note -

When mirroring root (/), it is essential that you record the secondary root slice name to reboot the system if the primary submirror fails. This information should be written down, not recorded on the system, which may not be available. See Chapter 7, Troubleshooting the System for details on recording the alternate boot device, and on booting from the alternate boot device.


The high-level steps in this task are:


Note -

You cannot mirror root (/) on an IDE drive.


For the purpose of the following procedures, assume that the alternate disk is c0t1d0.

Create a Solaris Partition

Use these steps to create a Solaris partition on an x86 system.

  1. Create the disk partition using the fdisk(1M) command.


    # fdisk /dev/rdsk/c0t1d0p0
    
    1. If this is the first time you have run fdisk(1M), you see the following:


      The recommended default partitioning for your disk is:
       
      a 100% "SOLARIS System" partition
       
      To select this, please type "y". To partition your disk
      differently, type "n" and the "fdisk" program will let you
      select other partitions.
    2. If you have previously run fdisk(1M), you see a menu similar to the following:


              Total disk size is 1855 cylinders
              Cylinder size is 1110 (512 byte) blocks
       
      Partition    Status    Type        Start    End    Length    %
      =========    ======    ========    =====    ===    ======   ===
          1        Active    SOLARIS         1   1854     1854    100
       
       
      SELECT ONE OF THE FOLLOWING:
       
           1.  Create a partition
           2.  Change Active (Boot from) partition
           3.  Delete a partition
           4.  Exit (Update disk configuration and exit)
           5.  Cancel (Exit without updating disk configuration)
      Enter Selection:
  2. Select menu items to ensure that you have a Solaris partition large enough for the root (/) mirror. The Solaris partition should be five cylinders larger than the size needed to hold the root (/) slice.

    Make sure that the Solaris partition is active. Otherwise, you will be unable to boot from it.

  3. Run the format(1M)command on the Solaris partition to create a slice for the root (/) mirror:


    # format
    Searching for disks...done
     
    AVAILABLE DISK SELECTIONS:
           0. c0t0d0 <DEFAULT cyl 2676 alt 2 hd 9 sec 85>
              /eisa/ncrs@8000,0/cmdk@0,0
           1. c1t1d0 <DEFAULT cyl 1865 alt 2 hd 7 sec 80>  ABCDEFG
              /eisa/eha@1000,0/cmdk@1,0
           2. c1t2d0 <DEFAULT cyl 1461 alt 2 hd 9 sec 64>
              /eisa/eha@1000,0/cmdk@2,0
           3. c1t3d0 <DEFAULT cyl 1461 alt 2 hd 9 sec 64>
              /eisa/eha@1000,0/cmdk@3,0
           4. c1t4d0 <DEFAULT cyl 1865 alt 2 hd 7 sec 80>
              /eisa/eha@1000,0/cmdk@4,0
    Specify disk (enter its number): 1
     
    selecting c1t1d0: ABCDEFG
    [disk formatted]
     
    FORMAT MENU:
    			disk 					- select a disk
    			type					- select (define) a disk type
    			partition					- select (define) a partition table
    			current					- describe the current disk
    			format					- format and analyze the disk
    			fdisk					- run the fdisk program
    			repair					- repair a defective sector
    			label					- write label to the disk
    			analyze					- surface analysis
    			defect					- defect list management
    			backup					- search for backup labels
    			verify					- read and display labels
    			save					- save new disk/partition definitions
    			inquiry					- show vendor, product and revision
    			volname					- set 8-character volume name
    			quit
  4. Select partition to define a partition:


    format> partition
     
    PARTITION MENU:
            0      - change `0' partition
            1      - change `1' partition
            2      - change `2' partition
            3      - change `3' partition
            4      - change `4' partition
            5      - change `5' partition
            6      - change `6' partition
            7      - change `7' partition
            select - select a predefined table
            modify - modify a predefined partition table
            name   - name the current table
            print  - display the current table
            label  - write partition map and label to the disk
            quit
    partition> 0
    Part				Tag				Flag			Cylinders							Size				Blocks
      0			unassigned   wm	     0														0				(0/0/0)
     
    Enter partition id tag [unassigned]: root
    Enter partition permission flags [wm]: wm
    Enter new starting cyl [0]: 4
    Enter partition size [0b, 0c, 0.00mb]: 400mb
    partition> label
    Ready to label disk, continue? y
    partition>
  5. Exit from the partition menu and the format(1M) program by typing the quit command twice.


    partition> quit
     
    FORMAT MENU:
            disk       - select a disk
            type       - select (define) a disk type
            partition  - select (define) a partition table
            current    - describe the current disk
            format     - format and analyze the disk
            repair     - repair a defective sector
            label      - write label to the disk
            analyze    - surface analysis
            defect     - defect list management
            backup     - search for backup labels
            verify     - read and display labels
            save       - save new disk/partition definitions
            inquiry    - show vendor, product and revision
            volname    - set 8-character volume name
            quit
    format> quit
    

    Note the following important information about the Solaris root (/) partition:

    • Its I.D. tag must be "root"

    • Its size must be greater than or equal to the size of the original root partition

    • It should not use cylinders 0-2

Install Boot Information

Use the installboot(1M) command to install the boot information on the alternate boot disk:


# installboot /usr/lib/fs/ufs/pboot
/usr/lib/fs/ufs/bootblk  /dev/rdsk/c0t1d0s0

Example -- x86: Creating a Mirror From root (/)

This example assumes that a Solaris partition has been created and installed with the boot information using the tasks above.


# metainit -f d10 1 1 c0t0d0s0
d10:Concat/Stripe is setup
# metainit d20 1 1 c1t0d0s0
d20: Concat/Stripe is setup
# metainit d0 -m d10
d10: Mirror is setup
# metaroot d0
# lockfs -fa
# reboot
...
# metattach d0 d20
d0: Submirror d20 is attached
# ls -l /dev/rdsk/c1t0d0s0
lrwxrwxrwx 1  root root  55 Mar 5 12:54  /dev/rdsk/c1t0d0s0 -> ../.
devices/eisa/eha@1000,0/cmdk@1,0:a

The -f option forces the creation of the first concatenation, d10, which contains the mounted file system root (/) on /dev/dsk/c0t0d0s0. The second concatenation, d20, is created from /dev/dsk/c1t0d0s0. (This slice must be the same size or greater than that of d10.) The metainit command with the -m option creates the one-way mirror d0 using the concatenation containing root (/). Next, the metaroot command edits the /etc/vfstab and /etc/system files so that the system may be booted with the root file system (/) on a metadevice. After a reboot, the submirror d20 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d20 is attached.) Using the ls -l command on the root raw device determines the path to the alternate root device in case the system needs to be booted from it.

Creating RAID5 Metadevices

This section describes how to create RAID5 metadevices.

Preliminary Information for Creating RAID5 Metadevices

How to Create a RAID5 Metadevice (DiskSuite Tool)

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

  2. Click the RAID5 template.

    An unassigned and uncommitted RAID5 object appears on the canvas. The metadevice name is automatically assigned.

  3. [Optional] Change the default metadevice name.

  4. [Optional] Change the default interlace size of 16 Kbytes.

    Display the object's pop-up menu and choose Info. The RAID Information window for this RAID5 metadevice appears.

    Graphic
  5. To change the interlace value, click Custom and type the new value in the field next to Custom. This value can be in Kbytes, Mbytes, or sectors, and is configurable via the drop-down menu beside this field. Click Attach to set the value, then click Close.

    See Solstice DiskSuite 4.2.1 Reference Guide for more information on setting the interlace value.

  6. Click Slices to open the Slice Browser.

  7. Select the slices and drag them to the top of the RAID5 object.

    Use Control-click to select multiple slices. You need at least three slices.

  8. Click the top rectangle of the RAID5 object then click Commit.

    DiskSuite starts initializing the RAID5 metadevice.

  9. To verify that the RAID5 metadevice was committed, display the Configuration Log.


    Note -

    You must wait for the initialization to finish before you can use the RAID5 metadevice.


Example

This example shows a RAID5 metadevice. Notice that the size displayed is 1.95 Gbytes even though the metadevice is made of three 999.63 Mbyte slices. (One slice's worth of storage capacity is used for parity.)

Graphic

Where to Go From Here

To prepare the newly created RAID5 metadevice for a file system, refer to "How to Create a File System on a Metadevice (File System Manager)". An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.

To associate a hot spare pool with a RAID5 metadevice, refer to "How to Associate a Hot Spare Pool (DiskSuite Tool)".

How to Create a RAID5 Metadevice (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating RAID5 Metadevices"), use the metainit(1M) command to create the RAID5 metadevice. For more information, refer to the metainit(1M) man page.

Example -- Creating a RAID5 Metadevice of Three Slices


# metainit d45 -r c2t3d0s2 c3t0d0s2 c4t0d0s2
d45: RAID is setup

The RAID5 metadevice d45 is created with the -r option from three slices. Because no interlace is specified, d45 uses the default of 16 Kbytes. The system verifies that the RAID5 metadevice has been set up, and begins initializing the metadevice.


Note -

You must wait for the initialization to finish before you can use the RAID5 metadevice.


Where to Go From Here

To prepare the newly created RAID5 metadevice for a file system, refer to "How to Create a File System on a Metadevice (Command Line)". An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.

To associate a hot spare pool with a RAID5 metadevice, refer to "How to Associate a Hot Spare Pool (Command Line)".

Creating Trans Metadevices

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

Preliminary Information for Creating Trans Metadevices


Caution - Caution -

Mirroring logging devices is strongly recommended. Losing the data in a logging device because of device errors can leave a file system in an inconsistent state which fsck(1M) may not be able to fix without user intervention. Using a mirror for the master device is a good idea to ensure data redundancy.


How to Create a Trans Metadevice for a File System That Can Be Unmounted (DiskSuite Tool)

Before beginning, identify the slice or metadevice that contains the file system. You'll need this when creating the master device. Also, decide if you want to mirror the logging device. If so, use "How to Create a Trans Metadevice Using Mirrors (DiskSuite Tool)". If you are mirroring the logging device, it is a good idea that the master device be a mirror also.

You can create a file system on the trans metadevice later if the master device doesn't already have a file system.

To create a trans metadevice for a file system, such as /usr, that cannot be unmounted during normal system operation, refer to "How to Create a Trans Metadevice for a File System That Cannot Be Unmounted (DiskSuite Tool)".

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

  2. Click the trans metadevice template.

    An unassigned and uncommitted Trans Metadevice object appears on the canvas. The metadevice name is automatically assigned.

  3. [Optional] Change the default metadevice name.

    Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.

  4. Drag the slice or metadevice that will contain the master device to the master rectangle in the trans metadevice template.

    When you can drag a slice from the Slice Browser, or drag a metadevice from the Objects list, a warning dialog box is displayed. Click Continue.


    Note -

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


  5. Select the slice or metadevice that will contain the logging device, and drag it to the log rectangle of the trans metadevice template.

    A Warning dialog box appears if the logging device is not mirrored.

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

  7. Unmount then remount the file system on the trans metadevice.

    Logging becomes effective for the file system when you remount the system. On subsequent reboots, instead of checking the file system, fsck(1M) displays this message:


    /dev/md/rdsk/dx: is logging.
  8. To verify that the trans metadevice was committed, display the Configuration Log.

Example -- Committed Trans Metadevice Object

This example shows a committed trans metadevice, d8, consisting of slice c3t0d0s5 for the master device, and a mirror, d5, for the logging device. Notice how the master and logging devices are displayed within the trans object.

Graphic

How to Create a Trans Metadevice for a File System That Can Be Unmounted (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Trans Metadevices"), create the trans metadevice with the metainit(1M) command. Refer to the metainit(1M) man page for more information.

Example -- Creating a Trans Metadevice With a Slice for the Master Device


# umount /home1
# metainit d63 -t c0t2d0s2 c2t2d0s1
d63: Trans is setup
(Edit the /etc/vfstab file so that the file system references the trans metadevice 
# umount /home1

Slice /dev/dsk/c0t2d0s2 contains a file system mounted on /home1. The slice to contain the logging device is /dev/dsk/c2t2d0s1. First, the file system is unmounted. The metainit command with the -t option creates the trans metadevice, d63.

Next, the /etc/vfstab file must be edited to change the entry for the file system to reference the trans metadevice. For example, the following line:


/dev/dsk/c0t2d0s2 /dev/rdsk/c0t2d0s2 /home1 ufs 2 yes -

should be changed to:


/dev/md/dsk/d63 /dev/md/rdsk/d63 /home1 ufs 2 yes -

Logging becomes effective for the file system when it is remounted.

On subsequent reboots, instead of checking the file system, fsck(1M) displays a logging message for the trans metadevice:


# reboot
...
/dev/md/rdsk/d63: is logging

Example -- Creating a Trans Metadevice With a Stripe for the Master Device


# umount /home2
# metainit d40 -t d2 c1t2d0s0
d40: Trans is setup
(Edit the /etc/vfstab file so that the file system references the trans metadevice)
# mount /home2

Stripe d2 contains a file system mounted on /home2. The slice to contain the logging device is /dev/dsk/c1t2d0s0. First, the file system is unmounted. The metainit command with the -t option creates the trans metadevice, d40.

Next, the /etc/vfstab file must be edited to change the entry for the file system to reference the trans metadevice. For example, the following line:


/dev/md/dsk/d2 /dev/md/rdsk/d2 /home2 ufs 2 yes -

should be changed to:


/dev/md/dsk/d40 /dev/md/rdsk/d40 /home2 ufs 2 yes -

Logging becomes effective for the file system when it is remounted.

On subsequent reboots, instead of checking the file system, fsck(1M) displays a logging message for the metadevice:


# reboot
...
/dev/md/rdsk/d40: is logging

How to Create a Trans Metadevice for a File System That Cannot Be Unmounted (DiskSuite Tool)

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

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

  2. Click the trans metadevice template.

    An unassigned and uncommitted Trans Metadevice object appears on the canvas. The metadevice name is automatically assigned.

  3. [Optional] Change the default metadevice name.

    Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.

  4. Click Slices to open the Slice Browser.

  5. Select the slice or metadevice that contains the file system to be logged, and drag it to the master rectangle in the Trans Metadevice object.

    This must be the slice or metadevice that contains the file system.

  6. Confirm the device that will be the master.

    Click the Continue button on the dialog box that appears.

  7. Select the slice or metadevice that will contain the logging device, and drag it to the log rectangle of the Trans Metadevice object.

  8. Confirm the slice that will be the log.

    Click the Continue button on the dialog box that appears.

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

    Click the Really Commit button on the confirmation dialog box.

  10. To verify that the trans metadevice was committed, display the Configuration Log.

  11. Reboot.

    After the reboot, logging becomes effective for the file system.

Example -- Committed Trans Object for /usr

This example shows a trans metadevice that contains the /usr file system.

Graphic

How to Create a Trans Metadevice for a File System That Cannot Be Unmounted (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Trans Metadevices"), use this procedure to log a file system, such as /usr, that cannot be unmounted during normal system operation. Refer to the metainit(1M) man page for more information.

Example -- Creating a Trans Metadevice for /usr


# metainit -f d20 -t c0t3d0s6 c1t2d0s1
d20: Trans is setup
(Edit the /etc/vfstab file so that the file system references the trans metadevice)
# reboot

Slice /dev/dsk/c0t3d0s6 contains the /usr file system. The slice to contain the logging device is /dev/dsk/c1t2d0s1. Because /usr cannot be unmounted, the metainit command is run with the -f option to force the creation of the trans device, d20. Next, the line in the /etc/vfstab file that mounts the file system must be changed to reference the trans metadevice. For example, the following line:


/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 1 no -

should be changed to:


/dev/md/dsk/d20 /dev/md/rdsk/d20 /usr ufs 1 no -

Logging becomes effective for the file system when the system is rebooted.

How to Create a Trans Metadevice Using Mirrors (DiskSuite Tool)

You can increase data availability of a trans metadevice by using mirrors for the master and logging devices. Failure to mirror the logging device could result in significant data loss if the logging slice experiences errors. If you are mirroring the logging device, it is a good idea that the master device be a mirror also.

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

  2. Refer to the tasks on creating mirrors ("How to Create a Mirror From Unused Slices (DiskSuite Tool)" to "How to Create a Mirror From a File System That Cannot Be Unmounted (Command Line)").

    Create two mirrors, one for the master device, and one for the logging device. The mirror for the master device must contain the file system.

  3. Refer to "How to Create a Trans Metadevice for a File System That Can Be Unmounted (DiskSuite Tool)".

    Use the mirrors created in step 2 for the master and logging devices.

How to Create a Trans Metadevice Using Mirrors (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Trans Metadevices"), use the metainit(1M) to create the trans metadevice.

Example -- Creating a Trans Metadevice Using Mirrors


# umount /home1
# metainit d64 -t d30 d12
d64: Trans is setup
(Edit the /etc/vfstab file so that the file system references the trans metadevice)
# mount /home1

Mirror d30 contains a file system mounted on /home1. The mirror to contain the logging device is d12. First, the file system is unmounted. The metainit command with the -t option creates the trans metadevice, d64.

Next, the line in the /etc/vfstab file that mounts the file system must be changed to reference the trans metadevice. For example, the following line:


/dev/md/dsk/d30 /dev/md/rdsk/d30 /home1 ufs 2 yes -

should be changed to:


/dev/md/dsk/d64 /dev/md/rdsk/d64 /home1 ufs 2 yes -

Logging becomes effective for the file system when the file system is remounted.

On subsequent file system remounts or system reboots, instead of checking the file system, fsck(1M) displays a logging message for the metadevice:


# reboot
...
/dev/md/rdsk/d64: is logging

Creating Hot Spare Pools

This section describes how to create hot spare pools, add slices to hot spare pools, and assign hot spare pools to metadevices.

Preliminary Information for Creating Hot Spare Pools

How to Create a Hot Spare Pool (DiskSuite Tool)

You can create an empty hot spare pool, and add hot spares later if necessary. If you choose to do so, skip Step 4 and Step 5 in this task.

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

  2. Click the Hot Spare Pool template.

    An unassigned and uncommitted Hot Spare Pool object appears on the canvas. The metadevice name is automatically assigned.

  3. [Optional] Change the default hot spare pool name.

    Display the object's pop-up menu and choose Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.

  4. Click Slices to open the Slice Browser.

  5. Select the slices and drag them into the Hot Spare Pool object.

    Use Control-click to select multiple slices.

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

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

Example -- Committed Hot Spare Pool Object

This example shows a committed hot spare pool object, hsp000, consisting of slice c0t1d0s2.

Graphic

Where to Go From Here

To add hot spares to the hot spare pool, refer to "How to Add a Hot Spare Slice to a Hot Spare Pool (DiskSuite Tool)". After creating the hot spare pool, you need to associate it with a submirror or RAID5 metadevice. See "How to Associate a Hot Spare Pool (DiskSuite Tool)".

How to Create a Hot Spare Pool (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Hot Spare Pools"), use the metainit(1M) command to create a hot spare pool. Refer to the metainit(1M) man page for more information.

Example -- Creating a Hot Spare Pool


# metainit hsp001 c2t2d0s2 c3t2d0s2
hsp001: Hotspare pool is setup

The hot spare pool hsp001 contains two disks as the hot spares. The system verifies that the hot spare pool has been set up.

Where to Go From Here

To add more hot spares to the hot spare pool, refer to "How to Add a Hot Spare Slice to a Hot Spare Pool (Command Line)". After creating the hot spare pool, you need to associate it with a submirror or RAID5 metadevice. See "How to Associate a Hot Spare Pool (Command Line)".

How to Associate a Hot Spare Pool (DiskSuite Tool)

A hot spare pool must exist before it can be associated with a submirror or RAID5 metadevice.

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

  2. Double-click the mirror or RAID5 metadevice in the Objects list.

    The object appears on the canvas.

  3. Choose Hot Spare Pools from the Browse menu then choose a hot spare pool object from the list.

    The hot spare pool should have slices the same size or larger than the submirrors in the mirror, or the slices in the RAID5 metadevice. Ideally, the Hot Spare Pool contains hot spares that are on a different controller than the slices in the metadevice.

  4. Drag the Hot Spare Pool object to the top of the metadevice object.

  5. Click the top rectangle of the metadevice object then click Commit.

  6. To verify that the hot spare pool was associated, display the Configuration Log.

Example -- Hot Spare Pool Associations

This example shows a hot spare pool associated with two submirrors.

Graphic

How to Associate a Hot Spare Pool (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Hot Spare Pools"), use the metaparam(1M) command to associate a hot spare pool. Refer to the metaparam(1M) man page for more information.

Example -- Associating a Hot Spare Pool with Submirrors


# metaparam -h hsp100 d10
# metaparam -h hsp100 d11
# metastat d0
d0: Mirror
    Submirror 0: d10
      State: Okay        
    Submirror 1: d11
      State: Okay        
...
 
d10: Submirror of d0
    State: Okay        
    Hot spare pool: hsp100
...
 
 
d11: Submirror of d0
    State: Okay        
    Hot spare pool: hsp100
...

The -h option associates a hot spare pool, hsp100, with two submirrors, d10 and d11, of a mirror, d0. The metastat command shows that the hot spare pool is associated with the submirrors.

Example -- Associating a Hot Spare Pool with a RAID5 Metadevice


# metaparam -h hsp001 d10
# metastat d10
d10: RAID
    State: Okay        
    Hot spare pool: hsp001
...

The -h option associates a hot spare pool named hsp001 with a RAID5 metadevice named d10. The metastat command shows that the hot spare pool is associated with the RAID5 metadevice.

How to Add a Hot Spare Slice to a Hot Spare Pool (DiskSuite Tool)

You can add a slice to one or more hot spare pools. When a hot spare is added, the existing order of the hot spares is preserved. The new hot spare is added at the end of the list of hot spares in the hot spare pool that is specified.

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

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

    The object appears on the canvas.

  3. Click Slices to open the Slice Browser.

  4. Select a slice then drag it into the Hot Spare Pool object.

    If the hot spare pool already contains slices, locate a slice of the same or greater size than the slice(s) in the hot spare pool.

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

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

Example -- Hot Spare Pool with Two Slices

This example shows a hot spare pool that initially consisted of one slice, c1t2d0s2. Slice c0t1d0s2 was added and the hot spare pool was committed.

Graphic

How to Add a Hot Spare Slice to a Hot Spare Pool (Command Line)

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


Note -

The added hot spare follows whatever hot spares already exist in the hot spare pool.


Example -- Adding a Hot Spare Slice to One Hot Spare Pool


# metahs -a hsp001 /dev/dsk/c3t0d0s2
hsp001: Hotspare is added

The -a option adds the slice /dev/dsk/c3t0d0s2 to hot spare pool hsp001. The system verifies that the slice has been added to the hot spare pool.

Example -- Adding a Hot Spare Slice to All Hot Spare Pools


# metahs -a -all /dev/dsk/c3t0d0s2
hsp001: Hotspare is added
hsp002: Hotspare is added
hsp003: Hotspare is added

The -a and -all options add the slice /dev/dsk/c3t0d0s2 to all hot spare pools configured on the system. The system verifies that the slice has been added to all hot spare pools.

How to Change the Associated Hot Spare Pool (DiskSuite Tool)

You can change a hot spare pool's association at any time as long as none of its slices are currently in use as hot spares.

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

  2. Double-click the Mirror or RAID5 object with the hot spare pool association to be changed in the Objects list.

    The object appears on the canvas.

  3. Double-click the Hot Spare Pool object in the Objects list to use as the replacement.

    The object appears on the canvas.

  4. Drag the Hot Spare Pool object onto the rectangle in the submirror or RAID5 object containing the hot spare pool to be replaced.

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

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


    Note -

    To avoid data fabrication, DiskSuite does not allow hot sparing of a metadevice if it contains slices in the "Last Erred" state. For more information, refer to "Overview of Replacing and Enabling Slices in Mirrors and RAID5 Metadevices".


Example -- Mirror Object with Hot Spare Pool Associations

This example shows a mirror that started with hot spare pool hsp000 associated with each submirror. Submirror d7 is now associated with hsp001.

Graphic

How to Change the Associated Hot Spare Pool (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Hot Spare Pools"), use the metaparam(1M) command to change the metadevice's associated hot spare pool. For more information, refer to the metaparam(1M) man page.

Example -- Changing the Hot Spare Pool Association


# metastat d4
d4: RAID
    State: Okay        
    Hot spare pool: hsp001
...
# metaparam -h hsp002 d4
# metastat d4
d4: RAID
    State: Okay        
    Hot spare pool: hsp002
...

In this example, the hot spare pool hsp001 is currently associated with a RAID5 metadevice named d4. The hot spare pool association is changed to hsp002. The metastat command shows the hot spare pool association before and after.

Creating Disksets

This section describes how to create disksets, and populate them with hosts and disk drives.


Note -

Currently, disksets are only supported on SPARCstorage Array disks.


Preliminary Information for Creating Disksets


Note -

Disksets must be created and configured using the DiskSuite command line interface. After you have created a diskset, you can administer state database replicas, metadevices, and hot spare pools within a diskset using either DiskSuite Tool or the command line utilities.


How to Create a Diskset (Command Line)

The high-level steps in creating a diskset are:

Before creating a diskset:


Note -

If you are not familiar with how to configure the same device names for the shared drives in the diskset, refer to "How to Configure Disk Drive Device Names for a Diskset (Command Line)".


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

  2. Create the diskset by defining the host(s) that have access to the devices.


    # metaset -s setname -a -h host...
    

    In this command,

    -s setname

    Specifies the name of a diskset on which metaset(1M) will work.

    -a

    Adds hosts to the named diskset. DiskSuite supports a maximum of two hosts per diskset. 

    -h host...

    Specifies one or more hosts to be added to a diskset. Adding the first host creates the set. The second host can be added later, but it is not accepted if all the drives within the set cannot be found on the specified host. host is the same name found in /etc/nodename.

  3. Check the status of the new diskset with the metaset(1M) command.


    # metaset
    

Example -- Creating Two Disksets


red# metaset -s relo-red -a -h red blue
red# metaset -s relo-blue -a -h red blue
red# metaset
Set name = relo-red, Set number = 1
 
Host                Owner
  red
  blue
 
Set name = relo-blue, Set number = 2
 
Host                Owner
  red
  blue

In this example, you create two shared disksets, relo-red and relo-blue, from the host red. The host names are red and blue, each with their own local disksets. The metaset command shows the status. At this point, neither set has an owner. The host that adds disks to the set will become the owner by default.

How to Add Drives to a Diskset (Command Line)

The following conditions must be satisfied for a drive to be accepted into a diskset:

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

  2. Add drives to the diskset.


    # metaset -s setname -a drivename...
    

    In this command,

    -s setname

    Specifies the name of a diskset on which metaset(1M) will work.

    -a

    Adds drives to the named diskset. 

    drivename...

    Specifies the drives to add to the diskset. Drive names are in the form cxtxdx; no "sx" slice identifiers are at the end of the name. They need to be the same on all hosts in the diskset.

    The first host to add a drive to a diskset becomes the implicit owner of the diskset.


    Caution - Caution -

    Do not add a disk with data; the process of adding it to the diskset repartitions the disk, destroying any data.


  3. Use the metaset(1M) command to verify the status of the diskset and drives.


    # metaset
    

Example -- Adding Drives to a Diskset


red# metaset -s relo-red -a c1t2d0 c1t3d0 c2t2d0 c2t3d0 c2t4d0 c2t5d0
red# metaset
Set name = relo-red, Set number = 1
 
Host                Owner
  red                Yes
  blue
 
Drive               Dbase
  c1t2d0             Yes
  c1t3d0             Yes
  c2t2d0             Yes
  c2t3d0             Yes
  c2t4d0             Yes
  c2t5d0             Yes
 
Set name = relo-blue, Set number = 2
 
Host                Owner
  red
  blue

In this example, the host names are red and blue, each with their own local disksets. The two shared disksets are relo-red and relo-blue. The disks in the set relo-red are normally accessed by host red, but may be accessed by host blue if red fails. At this point, no disks have been added to the diskset relo-blue.

Creating DiskSuite Objects in a Diskset

After you create a diskset, you can create metadevices and hot spare pools using the drives you added to the diskset. You can use either DiskSuite Tool or the command line utilities.

How to Create a DiskSuite Object in a Diskset (DiskSuite Tool)

To use DiskSuite Tool to create DiskSuite objects in a diskset, make sure you are the diskset owner and enter the command line:


# metatool -s diskset_name &

Use the DiskSuite Tool tasks in this chapter to create DiskSuite objects, such as mirrors and trans metadevices.

How to Create a DiskSuite Object in a Diskset (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), use the metainit(1M) command to create DiskSuite objects in a diskset. Refer to the metainit(1M) man page for more information.

Example -- Creating a Mirror in a Diskset


# metainit -s relo-red d51 1 1 /dev/dsk/c0t0d0s2
relo-red/d51: Concat/Stripe is setup
# metainit -s relo-red d52 1 1 /dev/dsk/c1t0d0s2
relo-red/d52: Concat/Stripe is setup
# metainit -s relo-red d50 -m d51
relo-red/d50: mirror is setup
# metattach -s relo-red d50 d52
relo-red/d50: Submirror d52 is attached

This example creates a mirror, d50, in diskset relo-red.

Creating File Systems on Metadevices

This section describes how to create a new file system on a metadevice.

Preliminary Information for Creating File Systems on Metadevices

How to Create a File System on a Metadevice (File System Manager)

This task assumes you have installed Solstice Storage Manager on the host you are working with, and that you have launched the Storage Manager application. For more information, see Appendix A, Using Storage Manager.

  1. Make sure you have met the prerequisites ("Prerequisites for Creating DiskSuite Objects") and have read the preliminary information ("Preliminary Information for Creating File Systems on Metadevices").

  2. Start File System Manager.

    If you have appropriately configured DiskSuite Tool, select File System Manager from the DiskSuite Tool "Tools" menu.

    If you have not configured DiskSuite Tool as such, you must first launch Storage Manager from the Solstice Launcher.


    Note -

    To configure DiskSuite to work with Storage Manager, refer to "How to Enable DiskSuite to Launch Storage Manager (Command Line)".


  3. Within the File System Manager main window, select Create from the Object menu, then select File System to display the Property Book for a new file system.

  4. Click Device in the Property Viewer portion of the window.

  5. Select and drag a metadevice from DiskSuite Tool's Metadevice Editor window to the Device Name text field.

  6. Click Apply.

    File System Manager begins building the new file system on the metadevice.

How to Create a File System on a Metadevice (Command Line)

After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating File Systems on Metadevices"), use the newfs(1M) command to create a new file system on a metadevice. Refer to the newfs(1M) man page for more information.

Example -- Creating a File System on a Concatenation


# newfs /dev/md/rdsk/d3
newfs: construct a new file system /dev/md/rdsk/d3: (y/n)? y
/dev/md/rdsk/d3:        917280 sectors in 1638 cylinders of 7 tracks, 80 sectors
        447.9MB in 103 cyl groups (16 c/g, 4.38MB/g, 2112 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 9072, 18112, 27152, 36192, 45232, 54272, 63312, 71712, 80752, 89792,
 98832, 107872, 116912, 125952, 134992, 143392, 152432, 161472, 170512, 179552,
 188592, 197632, 206672, 215072, 224112, 233152, 242192, 251232, 260272,
 269312, 278352, 286752, 295792, 304832, 313872, 322912, 331952, 340992,
 350032, 358432, 367472, 376512, 385552, 394592, 403632, 412672, 421712,
 430112, 439152, 448192, 457232, 466272, 475312, 484352, 493392, 501792,
 510832, 519872, 528912, 537952, 546992, 556032, 565072, 573472, 582512,
 591552, 600592, 609632, 618672, 627712, 636752, 645152, 654192, 663232,
 672272, 681312, 690352, 699392, 708432, 716832, 725872, 734912, 743952,
 752992, 762032, 771072, 780112, 788512, 797552, 806592, 815632, 824672,
 833712, 842752, 851792, 860192, 869232, 878272, 887312, 896352, 905392,
 914432,
# fsck /dev/md/rdsk/d3
** /dev/md/rdsk/d3
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
2 files, 9 used, 942654 free (14 frags, 117830 blocks,  0.0% fragmentation)

This example creates a file system on a concatenation named d3. The fsck(1M) command verifies the new file system.

Example -- Creating a File System on a Concatenation Within a Diskset


# newfs /dev/md/relo-red/rdsk/d33
newfs: construct a new file system /dev/md/relo-red/rdsk/d33: (y/n)? y
/dev/md/relo-red/rdsk/d33:        917280 sectors in 1638 cylinders of 7 tracks,
80 sectors
        447.9MB in 103 cyl groups (16 c/g, 4.38MB/g, 2112 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 9072, 18112, 27152, 36192, 45232, 54272, 63312, 71712, 80752, 89792,
 98832, 107872, 116912, 125952, 134992, 143392, 152432, 161472, 170512, 179552,
 188592, 197632, 206672, 215072, 224112, 233152, 242192, 251232, 260272,
 269312, 278352, 286752, 295792, 304832, 313872, 322912, 331952, 340992,
 350032, 358432, 367472, 376512, 385552, 394592, 403632, 412672, 421712,
 430112, 439152, 448192, 457232, 466272, 475312, 484352, 493392, 501792,
 510832, 519872, 528912, 537952, 546992, 556032, 565072, 573472, 582512,
 591552, 600592, 609632, 618672, 627712, 636752, 645152, 654192, 663232,
 672272, 681312, 690352, 699392, 708432, 716832, 725872, 734912, 743952,
 752992, 762032, 771072, 780112, 788512, 797552, 806592, 815632, 824672,
 833712, 842752, 851792, 860192, 869232, 878272, 887312, 896352, 905392,
 914432,

This example creates a file system on a concatenation name d33 in diskset relo-red.


Note -

A file system that resides on a metadevice in a diskset cannot be automatically mounted at boot via the /etc/vfstab file. The necessary diskset RPC daemons (rpc.metad and rpc.metamhd) do not start early enough in the boot process to permit this. Additionally, the ownership of a diskset is lost during a reboot.


Where to Go From Here

If You Want to Make the File System Available ... 

Then ... 

Now 

Mount the file system with the mount(1M) command, specifying the metadevice name as the mount device, such as /dev/md/dsk/d30.

Automatically when the system boots 

Create or modify the file system's entry in /etc/vfstab file, using the metadevice block and raw device names.

As a shared (exported) resource

Create a file system entry in the /etc/dfs/dfstab file.